Skip to content

fix(policy): classify DCode's observability preset by provenance - #12635

Merged
ericksoa merged 3 commits into
mainfrom
codex/11868-dcode-preset-provenance
Oct 5, 2026
Merged

ericksoa merged 3 commits into
mainfrom
codex/11868-dcode-preset-provenance

Conversation

@ericksoa

@ericksoa ericksoa commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Outcome

nemoclaw policy list labels DCode's automatically added observability-otlp-local preset [from dcode agent] instead of [user-added].

Reason

The provenance classifier already recognizes OpenClaw and Hermes presets but omits DCode. This changes the displayed attribution only; it does not change sandbox permissions or preset application.

This is the authorized NVIDIA-owned replacement for #11869 by @udsy19 (Udaya Tejas), preserving the contributor's commit and implementation. A signed follow-up commit only applies the required import formatting. The required reviewed OpenShell SDK CI job accepts only same-repository pull requests. The original PR will remain open until this replacement lands.

Related issues

Fixes #11868
Supersedes #11869.

Changes

  • Recognize DCode's existing agent name and preset set in classifyPresetProvenance().
  • Extend the existing baseline-provenance test with the DCode case.

Verification

  • npx --no-install vitest run --project cli src/lib/policy/preset-provenance.test.ts — 3 tests passed after the formatting correction in 63e47399cd.
  • Source CI on 63e47399cdbce8def6ff1715e61f03af0629a7d0 — passed, including all 12 CLI shards and coverage aggregation, plugin coverage, installer integration, npm audit, OpenShell SDK verification, OpenClaw distribution checks, typechecks, and static compatibility checks.
  • Self-hosted image qualification on the same commit — selected AMD64 and ARM64 image, security, port-override, and non-root smoke jobs passed. This was not the full E2E workflow.
  • Normal local publication hooks, including all three typechecks — passed. All three commits are GitHub Verified.
  • Inspected the two-file diff: no secrets, API keys, or credentials.

Review notes

Sensitive paths: src/lib/policy/preset-provenance.ts and its existing test. Maintainer-assisted source inspection of NVIDIA/NemoClaw candidate 087c9d9c3fd788579042e03e8df10d90b2071420 and the import-only formatting correction in 63e47399cd found no actionable defect; the classifier feeds policy-list display. CodeRabbit reported no actionable findings on the original contributor commit in #11869. No approval of this replacement is claimed.


Signed-off-by: Udaya Tejas udayatejas2004@gmail.com
Signed-off-by: Aaron Erickson aerickson@nvidia.com
Co-authored-by: Udaya Tejas udayatejas2004@gmail.com

Summary by CodeRabbit

  • Bug Fixes
    • Policy presets associated with the langchain-deepagents-code agent are now correctly recognized as agent-provided, improving their provenance identification.

udsy19 and others added 3 commits September 15, 2026 22:18
classifyPresetProvenance() only recognized agentName values "openclaw"
and "hermes"; every other agent fell through to { source: "user" }.

The canonical per-agent preset map, setupPolicyPresetAppliesToAgent()
(src/lib/onboard/agent-policy-presets.ts), has covered a third agent —
DCode (langchain-deepagents-code), via DCODE_ONLY_POLICY_PRESETS — since
#6340, a week after preset-provenance.ts was added in #5797. Nothing
since then wired DCode into the provenance classifier, so `policy list`
on a DCode sandbox with observability enabled labels its own auto-added
observability-otlp-local preset "[user-added]" instead of
"[from dcode agent]", understating what NemoClaw itself put there.

Signed-off-by: Udaya Tejas <udayatejas2004@gmail.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa self-assigned this Oct 5, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: f7faeb88-5dd5-440e-86cb-29475295caf6
📥 Commits

Reviewing files that changed from the base of the PR and between 04e99d3 and 63e4739.

📒 Files selected for processing (2)
  • src/lib/policy/preset-provenance.test.ts
  • src/lib/policy/preset-provenance.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The preset provenance classifier now identifies observability-otlp-local as agent-sourced when the agent is DCode. A test covers this classification.

Changes

DCode preset provenance

Layer / File(s) Summary
DCode provenance classification
src/lib/policy/preset-provenance.ts, src/lib/policy/preset-provenance.test.ts
The provenance type and classifier support DCode for its designated presets. A test checks that observability-otlp-local is classified as DCode agent provenance.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: apurvvkumaria

Merge Risk: ⚪ Minimal · up to 63e47

DCode’s preset attribution changes in policy listing only. No material policy-application or merge risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: classifying DCode’s observability preset by provenance.
Linked Issues check ✅ Passed [ #11868 ] The classifier now matches the normalized DCode agent name against DCODE_AGENT_NAME and the preset against DCODE_ONLY_POLICY_PRESETS, then returns { source: "agent", agent: "dcode" }.…
Out of Scope Changes check ✅ Passed Both changed files support [ #11868 ]: the classifier implements the requested display attribution, and its test verifies that behavior. The diff shows no unrelated changes to permissions or preset ap…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
🧰 Additional context used
📚 Code guidelines (1)
test/README.md — auto-discovered

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

@ericksoa

ericksoa commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

/ok to test 63e4739

@github-code-quality

github-code-quality Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 63e4739 in the codex/11868-dcode-pr... branch is 97%. The line coverage in commit 63002cd in the main branch is 96%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/11868-dcode-pr... 63e4739 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
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/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

The overall line coverage in commit 63e4739 in the codex/11868-dcode-pr... branch is 85%. The line coverage in commit 63002cd in the main branch is 84%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/11868-dcode-pr... 63e4739 +/-
src/lib/state/s...tory-restore.ts 86% 0% -86%
src/lib/actions.../status-text.ts 84% 46% -38%
src/lib/state/sandbox.ts 92% 83% -9%
src/lib/onboard...al-inference.ts 84% 90% +6%
src/lib/policy/index.ts 71% 79% +8%
src/lib/state/p...l-retirement.ts 79% 92% +13%
src/lib/onboard.../application.ts 55% 72% +17%
src/lib/adapter...gnostics-cli.ts 0% 87% +87%
src/lib/onboard...ternal-image.ts 0% 94% +94%
src/lib/securit...ig-structure.ts 0% 98% +98%

Updated October 05, 2026 22:26 UTC

@ericksoa
ericksoa marked this pull request as ready for review October 5, 2026 22:30
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 63e4739. 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

@ericksoa

ericksoa commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Approved for merge under the maintainer's instruction to land this owner replacement once CodeRabbit succeeds and regression risk is low.

Reviewed commit: 63e47399cdbce8def6ff1715e61f03af0629a7d0.

  • CodeRabbit completed its review of both changed files with no actionable findings and rated merge risk Minimal.
  • The diff changes policy-list attribution for DCode's existing observability preset. It does not change permissions or preset application.
  • Source CI passed, including all 12 CLI shards and coverage aggregation.
  • Selected image qualification passed on the same commit. This is not a claim of full E2E execution.
  • All published commits are GitHub Verified, and the original contributor's credit and sign-off are retained.

GitHub does not permit this account to submit a formal approval of the replacement PR it opened. This comment records the maintainer-authorized merge decision; the admin merge is for that owner-replacement approval constraint, with no CI waiver.

@ericksoa
ericksoa merged commit a5365ad into main Oct 5, 2026
95 of 96 checks passed
@ericksoa
ericksoa deleted the codex/11868-dcode-preset-provenance branch October 5, 2026 22:47
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Oct 14, 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: policy Network policy, egress rules, presets, or sandbox policy bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

policy list mislabels DCode's auto-added observability preset as user-added

3 participants