fix(shields): re-seal a perms-only config-lock drift on relock - #8086
Conversation
When a rebuild or manual relock re-confirms an already-locked /sandbox/.openclaw, an in-sandbox reconciler can re-permission .config-hash back to 660 sandbox:sandbox without changing its bytes. The guard's already-locked branch treated that perms-only drift as a hard config-not-locked reject, so the relock could never re-apply: host shields state was left UNLOCKED while the in-container state dirs stayed root-locked — a split where skill install fails, agent turns hit EACCES on credentials, and `shields down` refuses, with no clean recovery. Let the already-locked lock transition fall through to the re-seal path when the only drift is perms on a canonical file. Content or structural drift still fails closed: the hash check runs first and the config dir stays root-owned, so bytes cannot be swapped. The guard also emits a resealedDrift flag and the host prints "Re-sealed a perms-only config-lock drift", so a rebuild or relock no longer repairs drift invisibly. Covered by a guard-posture unit test, a result-parse test for the flag, and a live e2e phase that drives a real perms-only .config-hash drift. Signed-off-by: Hung Le <hple@nvidia.com>
Record the provenance of the perms-only config-lock reseal added in the
previous commit: name the writer (the upstream OpenClaw in-sandbox
gateway/doctor perm-normalizer, which NemoClaw does not own, so the host
relock re-seal is the correct layer) and the observable condition for
removing the path (durable lock immutability on every platform, or the
reconciler no longer re-permissioning a locked config). Addresses the PR
review advisor's request to record the authority and removal condition for
this security-sensitive recovery path.
Also apply Writing Guide cleanups to the changed comments and test title:
drop a judgment word and an em dash, capitalize "Python", and name the
verified posture ("unmodified" rather than "clean"). Comments and a test
title only; no behavior change.
Signed-off-by: Hung Le <hple@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. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe configuration guard now re-seals recognized permission-only drift on locked files. It reports ChangesConfiguration lock re-sealing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant Shields
participant ConfigGuard
participant ConfigHash
Operator->>Shields: run shields up
Shields->>ConfigGuard: transition lock
ConfigGuard->>ConfigHash: verify permissions
ConfigHash-->>ConfigGuard: report permission-only drift
ConfigGuard->>ConfigHash: re-seal permissions
ConfigGuard-->>Shields: return resealedDrift=true
Shields-->>Operator: emit self-healing message
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 2e9424e in the TypeScript / code-coverage/cliThe overall coverage in commit 2e9424e in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
4 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Hung Le <hple@nvidia.com>
…Claw into fix/reseal-config-lock-drift
There was a problem hiding this comment.
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 `@test/openclaw-config-guard-lock-reseal.test.ts`:
- Around line 74-89: Update the “perms-drift-reseals” scenario to model
permissions-only drift on .config-hash while keeping content and structure
unchanged, rather than injecting a generic config-not-locked error through
_verify_locked_files. Preserve the real classification path and stub only
low-level filesystem operations needed by lock() and _transition(). Track
_force_fail_closed_lock and assert fail_closed was not invoked while retaining
the re-seal and _resealed_drift assertions.
🪄 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: Enterprise
Run ID: c16f10bd-dba5-4ae1-b8da-d9536facd07d
📒 Files selected for processing (6)
scripts/openclaw-config-guard.pysrc/lib/shields/index.tssrc/lib/shields/openclaw-config-lock.test.tssrc/lib/shields/openclaw-config-lock.tstest/e2e/live/shields-config.test.tstest/openclaw-config-guard-lock-reseal.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- src/lib/shields/openclaw-config-lock.test.ts
- src/lib/shields/index.ts
- test/e2e/live/shields-config.test.ts
- scripts/openclaw-config-guard.py
- src/lib/shields/openclaw-config-lock.ts
Signed-off-by: Hung Le <hple@nvidia.com>
…Claw into fix/reseal-config-lock-drift
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Security review: PASS for revision 269e434.
- Secrets and credentials: PASS - no secret material or credential-handling surface is added.
- Input validation: PASS - recovery requires a matching config/hash pair plus the recognized metadata posture; malformed, unknown, flagged, writable-config, content, and structural states are rejected.
- Authentication and authorization: PASS - the host-authenticated guard remains the authority, and recovery is limited to a root-owned, read-only config with the expected sandbox-owned sidecar permissions.
- Dependencies and supply chain: PASS - no dependency or installer-source change.
- Logging and data exposure: PASS - the diagnostic reports only that a permissions repair occurred and exposes no configuration content.
- Cryptography and integrity: PASS - the stored digest must match the locked configuration bytes before any repair.
- Configuration and defaults: PASS - unexpected states fail closed; no permissive default or policy change is introduced.
- Test coverage: PASS - 68 Linux guard/parser tests pass, including realistic metadata snapshots, writable-config rejection, content/structural drift rejection, and confirmation that fail-closed handling is not invoked for the one recoverable posture.
- System security: PASS - the configuration must remain root-owned and read-only; only the known sidecar permission drift is repaired.
No security blocker remains in the implementation. Repository-wide dependency advisories, if reported by CI, remain an external merge gate and are not waived by this review.
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Prepares the canonical v0.0.102 release documentation from the current release-labeled scope. The change adds a dated changelog for all 38 user-facing shipping PRs and corrects the OpenClaw agent command reference for the behavior delivered by #8191. ## Changes - Add `docs/changelog/2026-08-04.mdx` with the v0.0.102 release summary, detailed behavior changes, support boundaries, security evidence links, and links to durable documentation. - Update `docs/reference/commands.mdx` to describe non-JSON OpenClaw output capture, its combined limit, marker handling, stream suppression, recovery guidance, and exit behavior. - [#8167](#8167) -> `docs/changelog/2026-08-04.mdx`: Records authenticated attachment of operator-managed llama.cpp servers. - [#8129](#8129) -> `docs/changelog/2026-08-04.mdx`: Records the Experimental managed vLLM profile for two DGX Spark systems. - [#7983](#7983) -> `docs/changelog/2026-08-04.mdx`: Records qualification of the May 2026 GB300WS factory image. - [#8207](#8207) -> `docs/changelog/2026-08-04.mdx`: Records the qualified DGX Station driver transaction. - [#8208](#8208) -> `docs/changelog/2026-08-04.mdx`: Records mode-bound Express resume state. - [#8158](#8158) -> `docs/changelog/2026-08-04.mdx`: Records recovery of host-global dual-Station runtime ownership. - [#8145](#8145) -> `docs/changelog/2026-08-04.mdx`: Records Windows-host Ollama validation from Docker Desktop's network context. - [#8190](#8190) -> `docs/changelog/2026-08-04.mdx`: Records HTTP model pulls when WSL has no local Ollama executable. - [#8195](#8195) -> `docs/changelog/2026-08-04.mdx`: Records reuse of a healthy installer-managed CLI. - [#8053](#8053) -> `docs/changelog/2026-08-04.mdx`: Records early rejection of incompatible OpenShell gateway versions. - [#8098](#8098) -> `docs/changelog/2026-08-04.mdx`: Records the bounded package-service-to-standalone gateway recovery transition. - [#8216](#8216) -> `docs/changelog/2026-08-04.mdx`: Records the final dashboard port selected during multi-sandbox onboarding. - [#8146](#8146) -> `docs/changelog/2026-08-04.mdx`: Records managed startup-state restoration for stopped sandboxes. - [#8092](#8092) -> `docs/changelog/2026-08-04.mdx`: Records gateway watchdog recovery for classified not-serving states. - [#8182](#8182) -> `docs/changelog/2026-08-04.mdx`: Records consistent managed-recovery wait configuration. - [#8040](#8040) -> `docs/changelog/2026-08-04.mdx`: Records Docker sandbox rollback authority through late validation. - [#8130](#8130) -> `docs/changelog/2026-08-04.mdx`: Records bounded Shields deadline recovery and durable containment. - [#8086](#8086) -> `docs/changelog/2026-08-04.mdx`: Records repair of narrowly validated permission-only configuration drift. - [#8122](#8122) -> `docs/changelog/2026-08-04.mdx`: Records prompt failure and guidance for corrupt transition locks. - [#8124](#8124) -> `docs/changelog/2026-08-04.mdx`: Records policy restoration flags, previews, and target revalidation. - [#7886](#7886) -> `docs/changelog/2026-08-04.mdx`: Records explicit destruction after pre-delete Shields hardening failures while preserving recovery authority. - [#7901](#7901) -> `docs/changelog/2026-08-04.mdx`: Records multi-port uninstall behavior and shared-resource preservation. - [#7984](#7984) -> `docs/changelog/2026-08-04.mdx`: Records one classified transient remote MCP startup retry. - [#7954](#7954) -> `docs/changelog/2026-08-04.mdx`: Records bounded hosted-inference probe replies. - [#7574](#7574) -> `docs/changelog/2026-08-04.mdx`: Records preservation of validated reasoning capabilities through onboarding. - [#8089](#8089) -> `docs/changelog/2026-08-04.mdx`: Records proxy routing for Hermes WhatsApp pairing and media traffic. - [#7682](#7682) -> `docs/changelog/2026-08-04.mdx`: Records native Hermes session deletion and identifier validation. - [#8150](#8150) -> `docs/changelog/2026-08-04.mdx`: Records corporate CA trust for LangChain Deep Agents Code image builds. - [#8156](#8156) -> `docs/changelog/2026-08-04.mdx`: Records reviewed managed runtime dependency remediation. - [#8180](#8180) -> `docs/changelog/2026-08-04.mdx`: Records reviewed MCP discovery runtime dependency updates. - [#8196](#8196) -> `docs/changelog/2026-08-04.mdx`: Records private npm dependency remediation across managed images. - [#8203](#8203) -> `docs/changelog/2026-08-04.mdx`: Records reviewed Hermes and LangChain Deep Agents Code Python dependency updates. - [#8125](#8125) -> `docs/changelog/2026-08-04.mdx`: Records bounded diagnostics for invalid enumerated CLI values. - [#8193](#8193) -> `docs/changelog/2026-08-04.mdx`: Records bounded diagnostics for unresolved sandbox base images. - [#8118](#8118) -> `docs/changelog/2026-08-04.mdx`: Records bounded diagnostics for changed gateway authority. - [#8191](#8191) -> `docs/changelog/2026-08-04.mdx`, `docs/reference/commands.mdx`: Records output capture, marker handling, recovery guidance, and exit behavior for non-JSON OpenClaw agent commands. - [#8187](#8187) -> `docs/changelog/2026-08-04.mdx`: Records the aligned interactive-installation start across supported agents. - [#8153](#8153) -> `docs/changelog/2026-08-04.mdx`: Records current product capabilities and support boundaries. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: This documentation-only release preparation does not change executable behavior. Existing changelog and published-route tests pass. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: Independently reviewed `docs/changelog/2026-08-04.mdx` and `docs/reference/commands.mdx` at commit `b89913780`. All 38 user-facing v0.0.102 PRs are represented, #8191 behavior matches the implementation, and the writing rules, documentation style, controlled terminology, route structure, and skip policy pass review. Targeted tests pass 36/36 and the documentation build completes with 0 errors. - Agent: Codex Desktop independent documentation writer <!-- docs-review-head-sha: b899137 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable - Station profile/scenario: Not applicable - Result: Not applicable - Supporting evidence: Not applicable ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run --project integration test/changelog-docs.test.ts test/check-docs-published-routes.test.ts` passed 36/36. - [x] Applicable broad gate passed — not applicable to documentation-only changes; `npm run docs` completed successfully with 0 errors. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — completed with 0 errors and 2 existing Fern warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [x] New doc pages include SPDX header and frontmatter (new pages only) — the native dated changelog uses the required parser-safe MDX SPDX comment and intentionally has no frontmatter. --- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Added release notes for v0.0.102, covering authentication, hardware setup, WSL, installer recovery, sandbox resilience, policy management, inference reliability, CLI improvements, and unified quickstarts. - Updated command documentation to explain how non-JSON agent output is collected, replayed, and reported. - **Bug Fixes** - Improved command-output recovery guidance when output exceeds limits or contains unsupported fallback markers. - Preserved accurate command exit-status reporting after output processing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Summary
After a rebuild or manual relock, an OpenClaw sandbox whose already-locked
.config-hashhad been re-permissioned by an in-sandbox reconciler (perms only, bytes intact) failed the relock and split: host shields reported UNLOCKED while the in-container state dirs stayed root-locked, breaking skill install and agent turns with no clean recovery. The already-locked lock transition now re-seals that perms-only drift in place instead of failing closed, and the host printsRe-sealed a perms-only config-lock driftso the self-heal is visible; content or structural drift still fails closed.Related Issue
Parts of #7985 — fixes the rebuild config-lock drift/split (status UNLOCKED but state dirs stay locked). The credentials-traversal EACCES symptom in #7985 is handled separately by #7603 (#7545) and is not closed here.
Refs #4663 (relock settle-window family), #7629 (unlock-side idempotency precedent).
Changes
scripts/openclaw-config-guard.py:_transition("lock")now repairs only the recognized sidecar-permission drift after_snapshot_pairproves the stored digest still matches the configuration bytes. Recovery additionally requiresopenclaw.jsonto remainroot:root 0444with no blocking inode flags and.config-hashto be exactlysandbox:sandbox 0660with no blocking flags. Writable configuration, content drift, structural drift, unknown metadata, and flagged files still fail closed. The guard also emits aresealedDriftresult flag.relockAndReconfirmvia the rebuild'sactivateLockdownFromSnapshotandshields updrift-repair) re-confirms an already-locked config whose.config-hashwas re-permissioned by the upstream in-sandbox OpenClaw gateway/doctor perm-normalizer. NemoClaw does not own that writer, so a direct source fix is out of scope here; the host-authenticated relock re-seal is the correct defense layer. Removal condition documented inline: delete the path once the lock is durably immutable on every platform (chattr +i, unavailable on overlayfs today) or the upstream reconciler stops re-permissioning a locked config. Protected bytest/openclaw-config-guard-lock-reseal.test.tsand the live E2E phase below.src/lib/shields/openclaw-config-lock.ts: parse and validate the newresealedDriftboolean from the guard result.src/lib/shields/index.ts:transitionOpenClawTopConfigprints the host-visible re-seal line when the guard reportsresealedDrift, so a rebuild or relock no longer repairs drift invisibly.shields up.Type of Change
Quality Gates
shields up/relock success on perms-only drift; no documented CLI/API/config contract changes. The added line is diagnostic output.Documentation Writer Review
no-docs-neededDGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHub — all 15 commits are verified in GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailable — commit and push hooks passednpm run checks, CLI and plugin type-checks, test-title validation, and Vitest project-membership validation passed locallynpm run docsbuilds without warnings (doc changes only)Signed-off-by: Hung Le hple@nvidia.com
Summary by CodeRabbit
Bug Fixes
shields upnow recovers from permissions-only drift in locked configuration files by re-sealing them.Tests