Skip to content

refactor(cli): group openshell adapters - #2985

Merged
cv merged 82 commits into
mainfrom
refactor/layer-openshell-adapters
May 6, 2026
Merged

refactor(cli): group openshell adapters#2985
cv merged 82 commits into
mainfrom
refactor/layer-openshell-adapters

Conversation

@cv

@cv cv commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Move OpenShell-facing adapter modules out of the flat src/lib/ directory into src/lib/adapters/openshell/** so process/runtime boundaries are visible in paths.

Stack Navigation

Changes

  • Moved OpenShell command helpers to src/lib/adapters/openshell/client.ts.
  • Moved OpenShell runtime wrapper helpers to src/lib/adapters/openshell/runtime.ts.
  • Moved OpenShell binary resolution and timeout constants to resolve.ts and timeouts.ts.
  • Moved associated tests and updated action, command, and integration-test imports.
  • Kept behavior unchanged; this PR is a structural move plus import updates.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files --stage pre-push passes
  • npm run build:cli
  • npm run typecheck:cli
  • OpenShell adapter targeted tests pass
  • npm run ts-migration:guard -- --base origin/refactor/layer-domain-helpers --head HEAD
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

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

Summary by CodeRabbit

Release Notes

  • Refactor
    • Reorganized OpenShell integration modules into a streamlined adapter-based structure for improved maintainability and code organization.

cv added 30 commits May 2, 2026 13:36
@prekshivyas prekshivyas self-assigned this May 5, 2026
@cjagwani cjagwani assigned cjagwani and unassigned cjagwani May 5, 2026
cv added a commit that referenced this pull request May 6, 2026
## Summary
Move pure CLI/domain helper modules out of the flat `src/lib/` directory
into `src/lib/domain/**` so parser, action, and domain boundaries are
visible in paths.

## Stack Navigation
- Position: 54 of 60
- Previous PR: [#2970 — refactor(cli): split oclif commands by command
tree](#2970)
- Next PR: [#2985 — refactor(cli): group openshell
adapters](#2985)

## Changes
- Moved lifecycle option normalizers to
`src/lib/domain/lifecycle/options.ts`.
- Moved duration parsing, maintenance image/upgrade helpers, sandbox
destroy/log helpers, sandbox log options, and policy/channel arg helpers
under `src/lib/domain/**`.
- Moved helper tests with their modules and updated imports from
actions, command adapters, and tests.
- Kept behavior unchanged; this PR is a structural move plus import
updates.

## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [x] `npx prek run --all-files --stage pre-push` passes
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] Domain/helper targeted tests pass
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the style guide (doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Internal module structure reorganized to improve code organization and
maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
@cv
cv marked this pull request as ready for review May 6, 2026 02:37
@cv
cv changed the base branch from refactor/layer-domain-helpers to main May 6, 2026 02:37
@cv
cv enabled auto-merge (squash) May 6, 2026 02:37
cv and others added 3 commits May 5, 2026 19:38

@prekshivyas prekshivyas 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. Same #2967/#2984-pattern PR — pure file-organization, 44 files / +86 / -83.

Four OpenShell adapter modules (client, runtime, resolve, timeouts) moved to src/lib/adapters/openshell/. 39 consumer files have one-line import-path updates. Slightly larger consumer diffs (sandbox-destroy-action.ts +6/-6, sandbox-status-action.ts +5/-2, etc.) are files that import multiple openshell adapters at once. scripts/check-legacy-migrated-paths.ts update is the migration-guard list — required for the move.

Verification checklist explicitly cites ts-migration:guard — strong signal nothing escaped the move.

CI: pr.yaml mostly green (lint/dco/check-hash/legacy-path-guard/changes PASS); macos-e2e/wsl-e2e/checks + pr-self-hosted builds still in flight at review time. No failures.

@cv
cv disabled auto-merge May 6, 2026 03:05
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv enabled auto-merge (squash) May 6, 2026 03:07
@cv
cv merged commit 2ee1264 into main May 6, 2026
12 checks passed
@ericksoa ericksoa added v0.0.36 and removed v0.0.35 labels May 6, 2026
cv added a commit that referenced this pull request May 6, 2026
## Summary
Add a narrow layer-boundary guard for the new CLI directory structure
before moving action/state/adapter modules further.

## Stack Navigation
- Position: 56 of 60
- Previous PR: [#2985 — refactor(cli): group openshell
adapters](#2985)
- Next PR: [#2987 — refactor(cli): group sandbox
actions](#2987)

## Changes
- Added `scripts/check-layer-import-boundaries.ts` to validate initial
import-boundary rules.
- Added a Vitest smoke test that runs the guard without source-shape
assertions.
- Enforces domain purity, no oclif imports from actions, no
command/action imports from adapters, and one registered oclif command
class per production command file.

## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [x] `npx prek run --all-files --stage pre-push` passes
- [x] `npx tsx scripts/check-layer-import-boundaries.ts`
- [x] `npx vitest run test/layer-import-boundaries.test.ts`
- [x] `npm run source-shape:check`
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the style guide (doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

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


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated pre-commit hook to improve formatting behavior during commits.
* Added automated validation to enforce code architecture layer
boundaries and prevent unintended cross-layer imports.
* **Tests**
* Added an automated test to verify the new layer-boundary validation
runs successfully and reports passing status.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv deleted the refactor/layer-openshell-adapters branch May 27, 2026 21:17
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery feature PR adds or expands user-visible functionality and removed NemoClaw CLI feature PR adds or expands user-visible functionality labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants