refactor(snapshot): lower cognitive complexity ratchet to 184#5430
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com> (cherry picked from commit 41fcd6a)
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…t/244-rebuild-cognitive-complexity
…243-rebuild-confirm-cognitive-complexity
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThree independent refactors extract inlined logic into named helpers: ChangesSnapshot Create Helper Extraction
Rebuild Messaging Config Hydration Extraction
Provider Choice Guard for Onboarding
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 46%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
## Summary Continue the stacked cognitive-complexity ratchet by lowering the threshold from 185 to 184. The previous stack step brought all remaining offenders to 184 or below, so this PR only tightens the Biome configuration. ## Changes - Lowered `complexity/noExcessiveCognitiveComplexity` from `185` to `184` in `biome.json`. ## 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 - `npx @biomejs/biome lint --only=complexity/noExcessiveCognitiveComplexity --max-diagnostics=none .` - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Tests added or updated for new or changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off required by CI. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…t/244-rebuild-cognitive-complexity
…243-rebuild-confirm-cognitive-complexity
…ratchet/225-rebuild-single-agent-guard
…4-rebuild-registry-guard # Conflicts: # src/lib/actions/sandbox/rebuild.ts
…build-version-header # Conflicts: # src/lib/actions/sandbox/rebuild.ts
…build-credential-preflight # Conflicts: # src/lib/actions/sandbox/rebuild.ts
…build-credential-preflight
…185-snapshot-onboard-tie
…egistry-guard # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
…build-version-header
…build-credential-preflight
…185-snapshot-onboard-tie
…ersion-header # Conflicts: # biome.json
…build-credential-preflight
…185-snapshot-onboard-tie
…185-snapshot-onboard-tie
…185-snapshot-onboard-tie
…redential-preflight # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
…185-snapshot-onboard-tie
…185-snapshot-onboard-tie
…185-snapshot-onboard-tie
…185-snapshot-onboard-tie
…onboard-tie # Conflicts: # biome.json # src/lib/actions/sandbox/rebuild.ts
…onboard-tie # Conflicts: # src/lib/actions/sandbox/snapshot.test.ts
Summary
Continue the stacked cognitive-complexity ratchet by lowering the threshold from 186 to 184. This handles the tied 186 hotspots by extracting snapshot creation and moving the setupNim provider-choice guard out of the top-level onboard file.
Changes
complexity/noExcessiveCognitiveComplexityfrom186to184inbiome.json.runSandboxSnapshotintorunSnapshotCreate.src/lib/onboard/setup-nim-selection.tssosrc/lib/onboard.tsstays net-neutral for the growth guardrail.Type of Change
Verification
npx @biomejs/biome lint --only=complexity/noExcessiveCognitiveComplexity --max-diagnostics=none .npm run typecheck:clinpx vitest run --project cli test/snapshot.test.ts test/openclaw-config-snapshot.test.ts test/security-sandbox-tar-traversal.test.ts src/lib/onboard/providers.test.ts src/lib/onboard/vllm-menu.test.tsGit hooks passed during commit and push, or
npx prek run --from-ref main --to-ref HEADpassesTargeted tests pass for changed behavior
Tests added or updated for new or changed behavior
Full
npm testpasses (broad runtime changes only)No secrets, API keys, or credentials committed
Docs updated for user-facing behavior changes
npm run docsbuilds 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