Skip to content

refactor(cli): remove legacy bin lib shims#1713

Merged
ericksoa merged 9 commits intomainfrom
refactor/remove-cli-shims
Apr 10, 2026
Merged

refactor(cli): remove legacy bin lib shims#1713
ericksoa merged 9 commits intomainfrom
refactor/remove-cli-shims

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 9, 2026

Summary

Remove the legacy bin/lib compatibility wrappers that no longer carry behavior, and point the CLI/tests at the compiled dist output or local TS modules instead. This trims the remaining root-level JavaScript surface while keeping the launcher and the two wrappers that still provide real compatibility behavior.

Changes

  • delete 18 obsolete bin/lib/*.js shims
  • keep bin/nemoclaw.js, bin/lib/usage-notice.js, and bin/lib/credentials.js
  • retarget CLI source from bin/lib/* to local src/lib/* modules where safe
  • retarget scripts/tests/E2E helpers from removed shims to dist/lib/*
  • include dist/ in the published package
  • update contributor/agent docs to reflect the new CLI layout

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Refactor
    • CLI core migrated to TypeScript and internal launch paths consolidated; legacy compatibility shims removed.
  • Chores
    • Published package now includes compiled build artifacts.
  • Tests
    • Tests and helper scripts updated to run against compiled distribution.
  • Documentation
    • Docs and contribution guidance updated; CI guard added to prevent reintroducing removed shims.
  • Notes
    • No public APIs or user-facing behavior changed.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removed many thin CommonJS shim entrypoints under bin/lib/, repointed imports/tests/scripts to local src/lib/ or compiled dist/lib/, added dist/ to package files, and extended CI/tooling to block reintroducing removed shims.

Changes

Cohort / File(s) Summary
Removed CommonJS shims
bin/lib/chat-filter.js, bin/lib/config-io.js, bin/lib/debug.js, bin/lib/inference-config.js, bin/lib/local-inference.js, bin/lib/nim.js, bin/lib/onboard-session.js, bin/lib/onboard.js, bin/lib/platform.js, bin/lib/policies.js, bin/lib/preflight.js, bin/lib/registry.js, bin/lib/resolve-openshell.js, bin/lib/runner.js, bin/lib/runtime-recovery.js, bin/lib/sandbox-build-context.js, bin/lib/services.js, bin/lib/version.js
Deleted many thin CommonJS re-export wrappers that forwarded to ../../dist/lib/*; those shim entrypoints no longer exist.
Source imports updated
src/lib/onboard.ts, src/lib/nim.ts, src/lib/local-inference.ts, src/lib/preflight.ts, src/lib/provider-models.ts, src/lib/usage-notice.ts, src/lib/debug.ts, src/nemoclaw.ts
Updated requires/imports to use local ./* modules or dist/lib/* where appropriate instead of ../../bin/lib/*; no functional logic changes.
Tests repointed to dist
src/lib/model-prompts.test.ts, src/lib/nim.test.ts, src/lib/onboard-session.test.ts, test/** (many files, e.g., test/onboard*.ts, test/*.test.ts, test/e2e/*)
Many tests and spawned-helper scripts now import from ../dist/lib/* instead of ../bin/lib/* or local src; removed obsolete shim cache invalidation in one test.
Scripts & shells adjusted
scripts/benchmark-sandbox-image-build.js, scripts/debug.sh, test/e2e/*, test/onboard-*.sh
Updated scripts and e2e helpers to load artifacts from dist/lib/* (e.g., onboard-session, credentials, runner) rather than bin/lib/*.
Package, CI & tooling
package.json, .github/workflows/legacy-path-guard.yaml, scripts/check-legacy-migrated-paths.ts, scripts/ts-migration/README.md
Added dist/ to package.json files; enhanced legacy-path guard to detect removed shim moves/edits with tailored messaging; updated CI job title and migration docs.
Documentation & risk notes
.agents/skills/nemoclaw-maintainer-day/RISKY-AREAS.md, AGENTS.md, CONTRIBUTING.md
Docs updated to reflect CLI core in src/lib/ (TS → dist/) and that only a minimal bin/ launcher remains.
New test for legacy guard
test/legacy-path-guard.test.ts
Added Vitest test that simulates renamed/removed shim and verifies the guard script fails with messaging about removed compatibility shims.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

NemoClaw CLI, refactor, CI/CD

Suggested reviewers

  • jyaunches
  • kjw3
  • ericksoa

"🐰
I hopped through paths both old and new,
Moved shims to dist and tidied the view.
Tests now chase built trails, scripts hum along,
The guard keeps holes closed — steady and strong.
🥕"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(cli): remove legacy bin lib shims' directly and clearly describes the main change: removing obsolete CommonJS re-export shim files from bin/lib. It is specific, concise, and accurately reflects the primary objective of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-cli-shims

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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)
AGENTS.md (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Add SPDX header comments at the top of this Markdown file.

AGENTS.md is changed in this PR and should include the required SPDX header block.

Suggested patch
+<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->
+<!-- SPDX-License-Identifier: Apache-2.0 -->
+
 # Agent Instructions

As per coding guidelines **/*.{js,ts,tsx,jsx,sh,md} must include SPDX license headers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` at line 1, Add the required SPDX license header block to the very
top of AGENTS.md; insert the standard SPDX comment block used across the repo
(e.g., lines like "SPDX-FileCopyrightText: <owner>" and
"SPDX-License-Identifier: <license>") so the file matches the policy for
**/*.{js,ts,tsx,jsx,sh,md}, ensuring the header appears before any other content
in AGENTS.md.
.agents/skills/nemoclaw-maintainer-day/RISKY-AREAS.md (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Please add the SPDX header to this changed Markdown file.

This file is covered by the repository-wide SPDX rule for Markdown sources.

Suggested patch
+<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->
+<!-- SPDX-License-Identifier: Apache-2.0 -->
+
 # NemoClaw Risky Code Areas

As per coding guidelines **/*.{js,ts,tsx,jsx,sh,md} must include SPDX license headers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/nemoclaw-maintainer-day/RISKY-AREAS.md at line 1, This
Markdown file (starts with the header "# NemoClaw Risky Code Areas") is missing
the required SPDX header; add a single-line SPDX license comment as the very
first line of the file in HTML-comment form, for example <!--
SPDX-License-Identifier: MIT --> (replace MIT with the repository's canonical
SPDX identifier), ensure it's placed before the "# NemoClaw Risky Code Areas"
title and followed by a blank line so the rest of the content remains unchanged.
🧹 Nitpick comments (2)
test/service-env.test.ts (1)

10-11: Inconsistent file extension in imports.

Line 10 imports without .js extension while line 11 includes .js. For consistency and to avoid potential module resolution issues when importing from compiled dist/ artifacts, consider using the same pattern for both imports.

♻️ Suggested fix for consistency
-import { resolveOpenshell } from "../dist/lib/resolve-openshell";
-import { parseAllowedChatIds, isChatAllowed } from "../dist/lib/chat-filter.js";
+import { resolveOpenshell } from "../dist/lib/resolve-openshell.js";
+import { parseAllowedChatIds, isChatAllowed } from "../dist/lib/chat-filter.js";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/service-env.test.ts` around lines 10 - 11, The two imports use
inconsistent extensions—update them to the same pattern (either both with .js or
both without) to avoid resolution issues: modify the import for resolveOpenshell
or the import for parseAllowedChatIds/isChatAllowed so both imports use the
identical extension style (refer to the symbols resolveOpenshell,
parseAllowedChatIds, isChatAllowed and adjust their import statements
accordingly).
test/onboard.test.ts (1)

1030-1033: Consider a tiny helper for dist module path stringification.

The repeated JSON.stringify(path.join(repoRoot, "dist", "lib", "...")) pattern is copy/paste-heavy; a helper would reduce maintenance risk.

♻️ Optional refactor sketch
+const distLib = (repoRoot, name) =>
+  JSON.stringify(path.join(repoRoot, "dist", "lib", `${name}.js`));

-const onboardPath = JSON.stringify(path.join(repoRoot, "dist", "lib", "onboard.js"));
-const runnerPath = JSON.stringify(path.join(repoRoot, "dist", "lib", "runner.js"));
-const registryPath = JSON.stringify(path.join(repoRoot, "dist", "lib", "registry.js"));
+const onboardPath = distLib(repoRoot, "onboard");
+const runnerPath = distLib(repoRoot, "runner");
+const registryPath = distLib(repoRoot, "registry");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/onboard.test.ts` around lines 1030 - 1033, The three variables
onboardPath, runnerPath, and registryPath duplicate
JSON.stringify(path.join(repoRoot, "dist", "lib", ...)) — extract a small helper
(e.g., distModulePath or makeDistPath) that accepts the module filename and
returns JSON.stringify(path.join(repoRoot, "dist", "lib", filename)), then
replace the three assignments to call that helper (use the same helper wherever
similar patterns appear) to reduce repetition and ease maintenance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.agents/skills/nemoclaw-maintainer-day/RISKY-AREAS.md:
- Line 1: This Markdown file (starts with the header "# NemoClaw Risky Code
Areas") is missing the required SPDX header; add a single-line SPDX license
comment as the very first line of the file in HTML-comment form, for example
<!-- SPDX-License-Identifier: MIT --> (replace MIT with the repository's
canonical SPDX identifier), ensure it's placed before the "# NemoClaw Risky Code
Areas" title and followed by a blank line so the rest of the content remains
unchanged.

In `@AGENTS.md`:
- Line 1: Add the required SPDX license header block to the very top of
AGENTS.md; insert the standard SPDX comment block used across the repo (e.g.,
lines like "SPDX-FileCopyrightText: <owner>" and "SPDX-License-Identifier:
<license>") so the file matches the policy for **/*.{js,ts,tsx,jsx,sh,md},
ensuring the header appears before any other content in AGENTS.md.

---

Nitpick comments:
In `@test/onboard.test.ts`:
- Around line 1030-1033: The three variables onboardPath, runnerPath, and
registryPath duplicate JSON.stringify(path.join(repoRoot, "dist", "lib", ...)) —
extract a small helper (e.g., distModulePath or makeDistPath) that accepts the
module filename and returns JSON.stringify(path.join(repoRoot, "dist", "lib",
filename)), then replace the three assignments to call that helper (use the same
helper wherever similar patterns appear) to reduce repetition and ease
maintenance.

In `@test/service-env.test.ts`:
- Around line 10-11: The two imports use inconsistent extensions—update them to
the same pattern (either both with .js or both without) to avoid resolution
issues: modify the import for resolveOpenshell or the import for
parseAllowedChatIds/isChatAllowed so both imports use the identical extension
style (refer to the symbols resolveOpenshell, parseAllowedChatIds, isChatAllowed
and adjust their import statements accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e1ea1326-9395-430f-bb04-fb6b63fe55b1

📥 Commits

Reviewing files that changed from the base of the PR and between 485825d and e2fc693.

📒 Files selected for processing (54)
  • .agents/skills/nemoclaw-maintainer-day/RISKY-AREAS.md
  • AGENTS.md
  • CONTRIBUTING.md
  • bin/lib/chat-filter.js
  • bin/lib/config-io.js
  • bin/lib/debug.js
  • bin/lib/inference-config.js
  • bin/lib/local-inference.js
  • bin/lib/nim.js
  • bin/lib/onboard-session.js
  • bin/lib/onboard.js
  • bin/lib/platform.js
  • bin/lib/policies.js
  • bin/lib/preflight.js
  • bin/lib/registry.js
  • bin/lib/resolve-openshell.js
  • bin/lib/runner.js
  • bin/lib/runtime-recovery.js
  • bin/lib/sandbox-build-context.js
  • bin/lib/services.js
  • bin/lib/version.js
  • package.json
  • scripts/benchmark-sandbox-image-build.js
  • scripts/debug.sh
  • src/lib/debug.ts
  • src/lib/local-inference.ts
  • src/lib/model-prompts.test.ts
  • src/lib/model-prompts.ts
  • src/lib/nim.test.ts
  • src/lib/nim.ts
  • src/lib/onboard-session.test.ts
  • src/lib/onboard.ts
  • src/lib/preflight.ts
  • src/lib/provider-models.test.ts
  • src/lib/provider-models.ts
  • src/lib/usage-notice.ts
  • src/nemoclaw.ts
  • test/credentials.test.ts
  • test/e2e/e2e-cloud-experimental/skip/04-nemoclaw-openshell-status-parity.sh
  • test/e2e/test-onboard-repair.sh
  • test/e2e/test-onboard-resume.sh
  • test/e2e/test-telegram-injection.sh
  • test/onboard-readiness.test.ts
  • test/onboard-selection.test.ts
  • test/onboard.test.ts
  • test/platform.test.ts
  • test/policies.test.ts
  • test/presets-checkbox.test.ts
  • test/registry.test.ts
  • test/resolve-openshell.test.ts
  • test/runner.test.ts
  • test/sandbox-build-context.test.ts
  • test/service-env.test.ts
  • test/ssh-known-hosts.test.ts
💤 Files with no reviewable changes (19)
  • bin/lib/platform.js
  • bin/lib/nim.js
  • bin/lib/config-io.js
  • bin/lib/services.js
  • bin/lib/version.js
  • bin/lib/onboard-session.js
  • bin/lib/resolve-openshell.js
  • bin/lib/preflight.js
  • bin/lib/debug.js
  • bin/lib/runtime-recovery.js
  • bin/lib/chat-filter.js
  • bin/lib/inference-config.js
  • src/lib/onboard-session.test.ts
  • bin/lib/runner.js
  • bin/lib/registry.js
  • bin/lib/sandbox-build-context.js
  • bin/lib/local-inference.js
  • bin/lib/policies.js
  • bin/lib/onboard.js

cv added 3 commits April 9, 2026 15:28
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/check-legacy-migrated-paths.ts (1)

19-38: Consider reducing mapping drift risk between shim maps.

REMOVED_SHIM_MOVES duplicates some keys already present in RUNTIME_MOVES (e.g., platform, runner, policies, onboard, sandbox-build-context). Consider deriving both from a single source-of-truth structure (or composing one map from another) to avoid future divergence.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/check-legacy-migrated-paths.ts` around lines 19 - 38,
REMOVED_SHIM_MOVES duplicates keys that also exist in RUNTIME_MOVES which risks
drift; refactor so these maps are derived from a single source-of-truth (e.g., a
baseMap or canonicalMoves) or build REMOVED_SHIM_MOVES by composing/filtering
RUNTIME_MOVES rather than duplicating entries; update code that references
REMOVED_SHIM_MOVES and RUNTIME_MOVES to use the new shared structure and ensure
identical key/value pairs for overlapping items like
"bin/lib/platform.js"/"src/lib/platform.ts" and
"bin/lib/runner.js"/"src/lib/runner.ts".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/check-legacy-migrated-paths.ts`:
- Around line 74-90: getChangedFiles currently only keeps the last path from git
--name-status lines, which misses the source path on rename/copy (status R/C)
and allows legacy guarded files to be bypassed; update getChangedFiles to parse
all path columns from the split line (for R* and C* events there will be a
source and destination) and emit ChangedFile entries for both the source and
destination paths (or otherwise ensure the source path is checked) instead of
only rest[rest.length - 1], referencing the getChangedFiles function and
handling statuses starting with "R" or "C" specially so the legacy guard catches
source-side renames/copies.

---

Nitpick comments:
In `@scripts/check-legacy-migrated-paths.ts`:
- Around line 19-38: REMOVED_SHIM_MOVES duplicates keys that also exist in
RUNTIME_MOVES which risks drift; refactor so these maps are derived from a
single source-of-truth (e.g., a baseMap or canonicalMoves) or build
REMOVED_SHIM_MOVES by composing/filtering RUNTIME_MOVES rather than duplicating
entries; update code that references REMOVED_SHIM_MOVES and RUNTIME_MOVES to use
the new shared structure and ensure identical key/value pairs for overlapping
items like "bin/lib/platform.js"/"src/lib/platform.ts" and
"bin/lib/runner.js"/"src/lib/runner.ts".
🪄 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: CHILL

Plan: Pro

Run ID: ea18f08b-3b0e-442f-8fd7-ae48d316fe34

📥 Commits

Reviewing files that changed from the base of the PR and between e2fc693 and c4e1451.

📒 Files selected for processing (3)
  • .github/workflows/legacy-path-guard.yaml
  • scripts/check-legacy-migrated-paths.ts
  • scripts/ts-migration/README.md
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/legacy-path-guard.yaml
  • scripts/ts-migration/README.md

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/legacy-path-guard.test.ts (1)

33-61: Clean up temporary repos to avoid /tmp buildup.

Line 35 creates a temp repo, but it is never removed. Wrap the test body in try/finally and delete repoDir at the end.

♻️ Proposed cleanup refactor
 describe("ts-migration:guard", () => {
   it("blocks renaming a removed shim by checking the source path in R entries", { timeout: 15000 }, () => {
     const repoDir = initTempRepo("nemoclaw-legacy-guard-");
     const originalPath = path.join(repoDir, "bin", "lib", "runner.js");
     const renamedPath = path.join(repoDir, "tmp", "runner.js");
+    try {
 
-    fs.mkdirSync(path.dirname(originalPath), { recursive: true });
-    fs.writeFileSync(originalPath, "module.exports = {};\n");
-    run("git", ["add", "."], repoDir);
-    run("git", ["commit", "-m", "base"], repoDir);
+      fs.mkdirSync(path.dirname(originalPath), { recursive: true });
+      fs.writeFileSync(originalPath, "module.exports = {};\n");
+      run("git", ["add", "."], repoDir);
+      run("git", ["commit", "-m", "base"], repoDir);
 
-    run("git", ["checkout", "-b", "feature"], repoDir);
-    fs.mkdirSync(path.dirname(renamedPath), { recursive: true });
-    run("git", ["mv", "bin/lib/runner.js", "tmp/runner.js"], repoDir);
-    run("git", ["commit", "-m", "rename shim"], repoDir);
+      run("git", ["checkout", "-b", "feature"], repoDir);
+      fs.mkdirSync(path.dirname(renamedPath), { recursive: true });
+      run("git", ["mv", "bin/lib/runner.js", "tmp/runner.js"], repoDir);
+      run("git", ["commit", "-m", "rename shim"], repoDir);
 
-    const result = spawnSync(TSX, [GUARD_SCRIPT, "--base", "main", "--head", "HEAD"], {
-      cwd: repoDir,
-      encoding: "utf-8",
-    });
+      const result = spawnSync(TSX, [GUARD_SCRIPT, "--base", "main", "--head", "HEAD"], {
+        cwd: repoDir,
+        encoding: "utf-8",
+      });
 
-    expect(result.status).toBe(1);
-    expect(`${result.stdout}${result.stderr}`).toContain(
-      "Removed compatibility shims must not be reintroduced or edited directly:",
-    );
-    expect(`${result.stdout}${result.stderr}`).toContain(
-      "bin/lib/runner.js -> src/lib/runner.ts",
-    );
+      expect(result.status).toBe(1);
+      expect(`${result.stdout}${result.stderr}`).toContain(
+        "Removed compatibility shims must not be reintroduced or edited directly:",
+      );
+      expect(`${result.stdout}${result.stderr}`).toContain(
+        "bin/lib/runner.js -> src/lib/runner.ts",
+      );
+    } finally {
+      fs.rmSync(repoDir, { recursive: true, force: true });
+    }
   });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/legacy-path-guard.test.ts` around lines 33 - 61, The test creates a
temporary repository via initTempRepo assigned to repoDir but never removes it;
wrap the test body (everything after repoDir is set) in a try/finally block and
in the finally call a cleanup to remove repoDir (e.g. use fs.rmSync(repoDir, {
recursive: true, force: true }) or equivalent) so the temp repo is always
deleted even on failures; keep references to the existing symbols (repoDir,
initTempRepo, and the spawnSync/GUARD_SCRIPT invocation) and only add the
try/finally and cleanup call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/legacy-path-guard.test.ts`:
- Around line 33-61: The test creates a temporary repository via initTempRepo
assigned to repoDir but never removes it; wrap the test body (everything after
repoDir is set) in a try/finally block and in the finally call a cleanup to
remove repoDir (e.g. use fs.rmSync(repoDir, { recursive: true, force: true }) or
equivalent) so the temp repo is always deleted even on failures; keep references
to the existing symbols (repoDir, initTempRepo, and the spawnSync/GUARD_SCRIPT
invocation) and only add the try/finally and cleanup call.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e4af5d0a-8445-49e5-8848-7f1b5b4edf7a

📥 Commits

Reviewing files that changed from the base of the PR and between cc12762 and a453af5.

📒 Files selected for processing (2)
  • scripts/check-legacy-migrated-paths.ts
  • test/legacy-path-guard.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/check-legacy-migrated-paths.ts

@cv cv enabled auto-merge (squash) April 9, 2026 22:48
@cv
Copy link
Copy Markdown
Contributor Author

cv commented Apr 10, 2026

I merged the latest main into this branch and resolved the remaining conflict in src/lib/onboard.ts by keeping the shim-removal branch intent (local TS imports) while bringing in the new agent-onboarding path from main via ./agent-onboard.

Focused validation run:

  • npm run build:cli
  • npx vitest run test/legacy-path-guard.test.ts test/runner.test.ts test/credentials.test.ts test/service-env.test.ts

Those passed. CI is rerunning now.

@ericksoa ericksoa self-requested a review April 10, 2026 03:22
@ericksoa ericksoa merged commit 9dc3549 into main Apr 10, 2026
7 checks passed
@cv cv deleted the refactor/remove-cli-shims branch April 10, 2026 03:38
realkim93 added a commit to realkim93/NemoClaw that referenced this pull request Apr 12, 2026
Main underwent a large-scale refactoring while this PR was open:
- JS→TS migration: bin/lib/onboard.js → src/lib/onboard.ts,
  bin/nemoclaw.js → src/nemoclaw.ts (NVIDIA#1673)
- Legacy shim removal: 18 bin/lib/*.js files deleted (NVIDIA#1713)
- Command handler extraction: src/lib/onboard-command.ts (NVIDIA#1710)
- Test renames: .js → .ts across all test files

Conflict resolution:
- bin/nemoclaw.js: accept main's 6-line launcher (logic in src/nemoclaw.ts)
- src/lib/onboard.ts: take main's build context staging (fromDockerfile
  + agent + stageOptimized), keep Jetson gateway patch functions
- docs/get-started/quickstart.md: use main's table format, add Jetson row
- test/onboard.test.js: accept deletion (migrated to .ts)

Re-ported Jetson features onto new TS structure:
- Add setup-jetson to GLOBAL_COMMANDS, help text, and switch dispatch
  in src/nemoclaw.ts (not a deprecated alias — runs setup-jetson.sh)
- Add Jetson to ci/platform-matrix.json (source of truth for docs table)
- Add getGatewayImageTag and patchGatewayImageForJetson to exports in
  src/lib/onboard.ts
- Port 4 Jetson tests to test/onboard.test.ts (dist/lib/onboard paths)

Verified on Jetson Orin Nano Super (8GB, JetPack 6.x, Node 22.22.0):
- Build: tsc passes
- 4 Jetson tests: all pass
- GPU: jetson=true, 7619 MB unified memory
- Gateway: iptables v1.8.10 (legacy), io.nemoclaw.jetson-patched=true
- Sandbox: Phase Ready
- Inference: openclaw agent → "2 + 2 = 4."
- Path: sandbox → host.openshell.internal:11434 → Ollama → nemotron-3-nano:4b

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
realkim93 added a commit to realkim93/NemoClaw that referenced this pull request Apr 12, 2026
Main underwent a large-scale refactoring while this PR was open:
- JS→TS migration: bin/lib/onboard.js → src/lib/onboard.ts,
  bin/nemoclaw.js → src/nemoclaw.ts (NVIDIA#1673)
- Legacy shim removal: 18 bin/lib/*.js files deleted (NVIDIA#1713)
- Command handler extraction: src/lib/onboard-command.ts (NVIDIA#1710)
- Test renames: .js → .ts across all test files

Conflict resolution:
- bin/nemoclaw.js: accept main's 6-line launcher (logic in src/nemoclaw.ts)
- src/lib/onboard.ts: take main's build context staging (fromDockerfile
  + agent + stageOptimized), keep Jetson gateway patch functions
- docs/get-started/quickstart.md: use main's table format, add Jetson row
- test/onboard.test.js: accept deletion (migrated to .ts)

Re-ported Jetson features onto new TS structure:
- Add setup-jetson to GLOBAL_COMMANDS, help text, and switch dispatch
  in src/nemoclaw.ts (not a deprecated alias — runs setup-jetson.sh)
- Add Jetson to ci/platform-matrix.json (source of truth for docs table)
- Add getGatewayImageTag and patchGatewayImageForJetson to exports in
  src/lib/onboard.ts
- Port 4 Jetson tests to test/onboard.test.ts (dist/lib/onboard paths)

Verified on Jetson Orin Nano Super (8GB, JetPack 6.x, Node 22.22.0):
- Build: tsc passes
- 4 Jetson tests: all pass
- GPU: jetson=true, 7619 MB unified memory
- Gateway: iptables v1.8.10 (legacy), io.nemoclaw.jetson-patched=true
- Sandbox: Phase Ready
- Inference: openclaw agent → "2 + 2 = 4."
- Path: sandbox → host.openshell.internal:11434 → Ollama → nemotron-3-nano:4b

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants