Skip to content

fix(snapshot): retire unused host Python sanitizer - #12766

Merged
rsliter merged 3 commits into
mainfrom
codex/11174-native-sanitizer
Oct 7, 2026
Merged

rsliter merged 3 commits into
mainfrom
codex/11174-native-sanitizer

Conversation

@rsliter

@rsliter rsliter commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Complete the main-branch removal of snapshot sanitization's host Python dependency. Hermes backups keep using the existing Node archive sanitizer, with regression coverage that rejects host Python invocation while verifying credential removal and preservation of live state.

Reason

Issue #11174 reported a Hermes rebuild failure when a verified host Python interpreter was unavailable. The active backup path moved to Node archive sanitization in #12340 after the retired plugin migration path was removed in #11825. The unused Python sanitizer module remained in the CLI source and compiled output.

Related issues

Fixes #11174 on main. The v1 branch and backports are out of scope.

Changes

  • Accept Linux terminal X state in the existing Ollama descendant-cleanup test, alongside absent and zombie states. This repairs the inherited CI failure while retaining rejection of live states and all timeout and cleanup assertions.

  • Delete the unused 849-line snapshot sanitizer boundary module. No production or test consumers remain.

  • Extend the existing Hermes backup test to reject both named and absolute-path host Python invocations, use the Hermes registry identity, and preserve its archive sanitization and unchanged-source assertions.

  • Add no dependency, prerequisite, installer behavior, or replacement sanitizer. Current documentation already reflects the active implementation.

Verification

  • Repair commit 6743094e828b27db633e0e45950bdf4e1838f1bf: vitest run --project cli src/lib/onboard/ollama-systemd/executable-proof.test.ts passed 30 tests; its Linux-only case was skipped on macOS and awaits current Linux CI. Commit hooks, publication validation, and CLI typechecking passed for this repair.

  • vitest run across snapshot, native authority, SQLite sanitization, and rebuild backup tests: 5 files, 69 tests passed.

  • vitest run --project integration test/state/snapshot.test.ts test/automation/pull-requests/growth-guardrails.test.ts: 2 files, 54 tests passed. Hermes regression: passed. Temporarily introducing an absolute /usr/bin/python3 call in the backup path made the regression fail; the mutation was removed.

  • npm run clean:cli followed by NODE_OPTIONS=--max-old-space-size=8192 npm run build:cli: passed; the deleted sanitizer is absent from the generated output. CLI and plugin typechecks passed during contributor setup.

  • Normal guarded git push with repository hooks: publication validation, CLI, plugin, and JavaScript configuration checks passed.

  • Commit hooks: passed, including formatting, lint, secrets, source-shape budget, growth guardrails, and commitlint.

  • Source and import audit: no remaining consumers of the deleted module.

  • Live DGX rebuild was not rerun. This change removes unreachable code and protects the existing archive behavior at its local runtime boundary.

  • The diff contains no secrets, API keys, or credentials. The test retains only synthetic values and the existing public proxy sentinel.

Review notes

Self-review of NVIDIA/NemoClaw commit 3527153d81dfb32913eb65460099fc3d29bc6c30 and its two changed paths confirmed that src/lib/security/snapshot-sanitizer-boundary.ts has no remaining callers and that active archive sanitization is unchanged. This sensitive-path deletion awaits independent review; no approval or waiver is claimed.


Signed-off-by: Rebecca Sliter 571084+rsliter@users.noreply.github.com

Summary by CodeRabbit

  • Bug Fixes
    • Hermes snapshot backups now perform sanitization without launching Python, reducing reliance on Python being available in the host environment.
  • Tests
    • Updated snapshot coverage to verify that Hermes backups do not invoke Python and register the appropriate sandbox for backup scenarios. Adjusted process-state test coverage to account for an additional valid observed process state.

@rsliter rsliter self-assigned this Oct 7, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: d548e19b-0bd7-4487-a655-af4c542b922d
📥 Commits

Reviewing files that changed from the base of the PR and between ef8aebf and 6743094.

📒 Files selected for processing (1)
  • src/lib/onboard/ollama-systemd/executable-proof.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The snapshot sanitizer boundary module was deleted. Snapshot tests now use a sandbox registry helper that accepts an optional agent, and the Hermes backup test checks that backup does not invoke host Python. An executable-proof test accepts an additional process state.

Changes

Snapshot sanitizer and backup tests

Layer / File(s) Summary
Remove the Python sanitizer boundary
src/lib/security/snapshot-sanitizer-boundary.ts
The module containing trusted Python discovery, descriptor-relative snapshot operations, validation, and related types was deleted.
Update snapshot test setup and Hermes backup coverage
test/state/snapshot.test.ts
Snapshot tests use a registry helper that accepts an optional agent. The Hermes backup test registers the Hermes agent and checks that backup does not invoke host Python.
Accept the EXIT_DEAD process state
src/lib/onboard/ollama-systemd/executable-proof.test.ts
The descendant-process test accepts "X" in addition to the empty and "Z" states.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: ericksoa, prekshivyas

Merge Risk: ⚪ Minimal · up to 67430

The inspected changes do not introduce a demonstrated backup, rebuild, or test risk; the reported Hermes rebuild path uses its managed sandbox interpreter rather than host Python.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Ollama descendant-cleanup test change accepts Linux process state X. This change repairs a separate Ollama systemd test and has no connection to Hermes backup behavior or issue #11174. The sanit… Remove the Ollama test repair from this pull request or move it to a separate pull request. Keep the Hermes backup and unused Python sanitizer changes here.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #11174 requires Hermes rebuild to work when the host has no verified Python interpreter. The PR removes the unused Python snapshot boundary and keeps the active Node archive sanitizer. The Herme…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removal of the unused host Python snapshot sanitizer.
Full details: Out of Scope Changes check

Explanation

The Ollama descendant-cleanup test change accepts Linux process state X. This change repairs a separate Ollama systemd test and has no connection to Hermes backup behavior or issue #11174. The sanitizer deletion and Hermes test changes are in scope.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-code-quality

github-code-quality Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 6743094 in the codex/11174-native-s... branch is 97%. The line coverage in commit 63002cd in the main branch is 96%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/11174-native-s... 6743094 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...t-management.ts 100% 100% 0%
nemoclaw/src/co.../config-show.ts 100% 100% 0%
nemoclaw/src/commands/slash.ts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

The overall line coverage in commit 6743094 in the codex/11174-native-s... branch is 85%. The line coverage in commit 63002cd in the main branch is 84%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/11174-native-s... 6743094 +/-
src/lib/actions.../status-text.ts 84% 46% -38%
src/lib/state/sandbox.ts 92% 83% -9%
src/lib/onboard...al-inference.ts 84% 90% +6%
src/lib/policy/index.ts 71% 80% +9%
src/lib/state/p...l-retirement.ts 79% 92% +13%
src/lib/onboard.../application.ts 55% 72% +17%
src/lib/inferen...nvidia/index.ts 0% 85% +85%
src/lib/adapter...gnostics-cli.ts 0% 87% +87%
src/lib/onboard...ternal-image.ts 0% 91% +91%
src/lib/securit...ig-structure.ts 0% 98% +98%

Updated October 07, 2026 21:03 UTC

@rsliter
rsliter marked this pull request as ready for review October 7, 2026 17:55
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 6743094. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@rsliter
rsliter requested a review from deepujain October 7, 2026 21:10

@deepujain deepujain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Removing the unused helper leaves archive sanitization with its current owner. The Hermes regression verifies credential removal and unchanged live state while rejecting host Python; no inline comments follow.

Advisor feedback: 0 of 0 items require changes; all nine specialists are clear.
Recommended E2E: full-e2e, security-posture, rebuild-hermes and rebuild-openclaw have not run on this commit. These are advisory under the default approval rule.
Tested: focused snapshot authority, SQLite, rebuild backup and Ollama tests; snapshot integration and growth guardrails; clean CLI and plugin builds; both typechecks; trusted approval checker passed. The Hermes regression also passed on the base, so the original bug was not reproduced. The Linux-only descendant case was skipped locally on macOS. Local publication validation was blocked by missing SDK installation.

@rsliter
rsliter merged commit 7d6f812 into main Oct 7, 2026
126 of 130 checks passed
@rsliter
rsliter deleted the codex/11174-native-sanitizer branch October 7, 2026 21:28
@wscurran wscurran added area: security Security controls, permissions, secrets, or hardening integration: hermes Hermes integration behavior refactor PR restructures code without intended behavior change labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: security Security controls, permissions, secrets, or hardening integration: hermes Hermes integration behavior refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DGX Spark][Install] Installer completes without checking required host python3, leaving Hermes rebuild unusable

3 participants