Skip to content

fix(policy): report live policy mismatch fields - #13358

Draft
rsliter wants to merge 1 commit into
mainfrom
codex/13349-personal-policy
Draft

rsliter wants to merge 1 commit into
mainfrom
codex/13349-personal-policy

Conversation

@rsliter

@rsliter rsliter commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

When OpenShell's live policy differs from a submitted policy, NemoClaw reports the differing policy field paths while continuing to fail closed. This draft is the first diagnostic revision for Personal preset issue #13349; it does not yet fix the mismatch. The planned OpenShell 0.1.3 upgrade also reproduces the failure.

Reason

The failed Personal E2E artifacts show that policy readback differs after submission, but retain no semantic field-level difference. A bounded, value-free field report is needed to identify the cause on the exact candidate commit.

Related issues

Refs #13349

Changes

  • Reuse operator-owned policy normalization for the existing comparison and a mismatch report. The policy mutation error consumes the report; a direct comparison failure gives no field-level evidence. The live-state regression test protects the report and fail-closed result.
  • Limit the report to eight field paths and 12 levels. Hash unrecognized field names and omit all values to avoid exposing policy content in E2E artifacts. The same test covers credential-shaped input and CIDR omission.

Verification

  • npm run build:policy-boundary passed.
  • npx vitest run --project cli src/lib/policy/policy-live-state.test.ts passed (20 tests).
  • npx oxlint src/lib/policy/index.ts src/lib/policy/policy-live-state.test.ts passed.
  • NODE_OPTIONS=--max-old-space-size=8192 npm run build:cli and NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cli passed.
  • Commit hooks and pre-push publication validation passed, including the CLI TypeScript check.
  • Exact commit 8bb0d39a0301fe791654e55244bf7c4c2e8b4d52: targets=common-egress-agent-openclaw-personal-public-fetch, jobs= (Docker, NVIDIA inference), run 38938104420 failed during policy application. Redacted readback reports seven extra live network policies and personal_open_internet missing live. E2E cleanup passed.
  • Native OpenShell 0.1.3 reproduction on macOS ARM64 Docker Desktop: an isolated 0.1.3 gateway and sandbox used NemoClaw's checked-in NVIDIA provider profile with a nonfunctional placeholder credential. Adding the reviewed Personal preset to that sandbox's base policy via openshell policy set --wait returned network endpoint ambiguity validation failed between personal_open_internet and _provider_nemoclaw_13349_provider, naming allowed_ips, protocol, and enforcement. The base policy hash and active version (1) were unchanged. The disposable sandbox, provider, gateway container, and state volume were removed. This confirms the 0.1.3 overlap mechanism; it is a focused native reproduction, not the full NemoClaw E2E.
  • Focused OpenShell 0.1.3 follow-up: matching Personal's allowed_ips list on a disposable fixed NVIDIA provider profile and selecting /v1/** let policy set --wait load active version 2; effective readback retained both the provider and Personal rules. This candidate changes the provider profile and does not represent the custom-provider E2E.
  • A separate disposable 0.1.3 sandbox used a representative custom HTTPS provider with one exact destination IP pin and a more-specific /v1/** request selector. The exact Personal preset still failed policy set --wait with endpoint ambiguity naming allowed_ips; the base policy hash and active version 1 were unchanged. This matches the custom provider generator's exact-IP pinning contract, but is not a replay of the full E2E fixture. Both disposable setups used nonfunctional placeholder credentials and were removed. The rejected policy cannot support positive public-fetch or credential probes, so those require a compatible representation first.
  • The diff contains no secrets, API keys, or credentials.

Review notes

src/lib/policy/index.ts and src/lib/policy/policy-live-state.test.ts are sensitive policy paths. No independent pre-publication review exists for NVIDIA/NemoClaw commit 8bb0d39a0301fe791654e55244bf7c4c2e8b4d52; independent review is pending.

The diagnostic paths identify the six OpenClaw baseline rules plus native_hosted_inference as extra live rules; Personal is absent. NemoClaw intentionally replaces those web rules with the hostless L4 Personal rule. The earlier E2E did not retain OpenShell's raw denial; the focused native 0.1.3 reproduction below confirms the provider-layer overlap mechanism.

The OpenShell 0.1.3 migration PR #12603 also reproduces this boundary on exact candidate commit 53a694dfa08872faf78fa71d55047ea7adfa0844: Personal public-fetch E2E job reaches native provider onboarding, then fails to confirm Personal policy submission; its cleanup passes. The artifact confirms openshell 0.1.3. This is independent evidence that the version upgrade alone does not resolve #13349.

OpenShell 0.1.3 policy submission validates the base policy together with attached provider rules. Its ambiguity validator treats a hostless Personal endpoint and an exact provider endpoint on port 443 as overlapping, and requires their allowed_ips metadata to agree. Personal has broad public/private CIDRs while the provider has a narrower or empty list. The focused native 0.1.3 repro confirms this validator rejects Personal with a native NVIDIA provider layer before saving the base policy. It does not establish the raw denial from the full custom-provider E2E, which still needs an exact-head passing result after a repair. The documented Personal contract requires uninspected L4 access to public and private ranges on ports 80 and 443, while native provider endpoint controls and credential handling must remain intact.

No further code revision has been made. The draft remains WIP pending a decision on how to support this combination with OpenShell 0.1.3 without changing those contracts.

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

Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com>
@rsliter rsliter self-assigned this Oct 16, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 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 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · 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 16, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/plugin

main 63002cd codex/13349-personal... 8bb0d39 +/-
96% 97% +1%
View coverage of the 10 most impacted files.
File main 63002cd codex/13349-personal... 8bb0d39 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...print/runner.ts 95% 95% 0%
nemoclaw/src/bl...ime-identity.ts 97% 97% 0%
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/ru...time-context.ts 100% 100% 0%
nemoclaw/src/sh...er-boundary.cts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

main 63002cd codex/13349-personal... 8bb0d39 +/-
84% 86% +2%
View coverage of the 10 most impacted files.
File main 63002cd codex/13349-personal... 8bb0d39 +/-
src/lib/onboard.ts 62% 50% -12%
src/lib/state/l...diness-lease.ts 66% 83% +17%
src/lib/inferen...ollama/proxy.ts 41% 61% +20%
src/lib/onboard.../application.ts 55% 84% +29%
src/lib/domain/...y/dimensions.ts 0% 71% +71%
src/lib/inferen...er/lifecycle.ts 0% 72% +72%
src/lib/actions...ry/operation.ts 0% 76% +76%
src/lib/actions...try/snapshot.ts 0% 78% +78%
src/lib/inferen...ovider/index.ts 0% 88% +88%
src/lib/onboard...ternal-image.ts 0% 91% +91%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 16, 2026 17:33 UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 8bb0d39. 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

This branch has not been deployed

No deployments
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.

Fix Personal preset policy submission/readback mismatch

1 participant