Skip to content

fix(auditor): Update auditor usages#221

Merged
anastasia-nesterenko merged 6 commits into
mainfrom
anesterenko/aircore-739-nvbug-310-baseline-tasks-fail-auditor-cli-command-mismatch
Jun 10, 2026
Merged

fix(auditor): Update auditor usages#221
anastasia-nesterenko merged 6 commits into
mainfrom
anesterenko/aircore-739-nvbug-310-baseline-tasks-fail-auditor-cli-command-mismatch

Conversation

@anastasia-nesterenko

@anastasia-nesterenko anastasia-nesterenko commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes auditor agentic-use task instructions and verifiers to use the current nemo auditor CLI surface instead of the removed nemo audit / audit-job commands.

Linear: AIRCORE-739

Changes

  • Update auditor default/custom-probes tasks from audit jobs create/get-status to auditor audit run
  • Update verifier code to use the plugin SDK namespace, client.auditor, for auditor configs and targets
  • Verify audit invocation through agent trajectory instead of expecting persisted audit jobs
  • Refresh related Auditor command guidance in the agents optimization skill and Studio suggestion text
  • Replace stale SDK README auditor example with a valid guardrail config example
  • Remove stale services/auditor/tests pytest discovery path

Testing

  • Not run: agentic-use tasks require the Harbor/platform test environment
  • Checked command/API wiring during review against the local auditor plugin SDK and CLI registration

Closes: AIRCORE-739

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated auditor CLI documentation to reflect new target and config creation workflow instead of audit jobs.
    • Added CLI command examples and revised success criteria for audit operations.
  • Tests

    • Updated test suites to validate auditor target and config creation patterns.
    • Removed legacy audit job validation tests.
    • Added tests for agent audit invocation with custom configurations.

Signed-off-by: anastasia-nesterenko <anesterenko@nvidia.com>
@anastasia-nesterenko
anastasia-nesterenko force-pushed the anesterenko/aircore-739-nvbug-310-baseline-tasks-fail-auditor-cli-command-mismatch branch from 67373b9 to 1974684 Compare June 9, 2026 00:15
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 19022/25079 75.8% 62.4%
Integration Tests 12036/23851 50.5% 25.7%

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The head commit changed during the review from 1a8c4f9 to 89b7c12.

📝 Walkthrough

Walkthrough

This PR migrates the auditor CLI workflow from job-based (nemo audit jobs create) to target/config-based (nemo auditor targets create + nemo auditor configs create + nemo auditor audit run --spec) across skill documentation, CLI suggestions, and three separate test validation scenarios.

Changes

Auditor CLI Workflow Migration

Layer / File(s) Summary
Command pattern migration in documentation and UI
plugins/nemo-agents/src/nemo_agents_plugin/skills/agents-optimize/SKILL.md, web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.ts, utils.spec.ts
Skill documentation and CLI suggestion generation replace nemo audit jobs create --model with nemo auditor targets create -d '{"model": ..., "type": ...}' and nemo auditor audit run --spec.
Custom probes CLI test workflow
tests/agentic-use/auditor-custom-probes-cli/instruction.md, README.md, tests/test_outputs.py
Instructions, README, and test suite updated to validate custom audit config creation, target creation, and audit run invocation using client.auditor.* API; removed job-based assertions and added agent trajectory checks for audit run command and config creation.
Default audit easy test workflow
tests/agentic-use/auditor-default-job-cli-easy/instruction.md, tests/test_outputs.py
Instructions and tests updated to verify target and config existence and assert agent invoked auditor audit run with matching config/target names; replaced job creation/status checks with config probe-spec validation.
Default audit standard test workflow
tests/agentic-use/auditor-default-job-cli/instruction.md, tests/test_outputs.py
Instructions and tests refocused on config/target validation and audit run invocation trajectory; removed job existence/spec checks and status polling assertions.
Test discovery configuration cleanup
pytest.ini
Removed services/auditor/tests from testpaths to narrow pytest discovery scope.

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#113: Parallel updates to auditor agent/CLI flows replacing nemo audit job patterns with nemo auditor targets/configs + audit run commands.

Suggested reviewers

  • tylersbray
  • parkanzky
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'fix(auditor): Update auditor usages' directly reflects the main objective: replacing deprecated audit commands with current auditor CLI surface across multiple files and test flows.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch anesterenko/aircore-739-nvbug-310-baseline-tasks-fail-auditor-cli-command-mismatch

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
tests/agentic-use/auditor-default-job-cli-easy/instruction.md (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update title to match current workflow.

Title says "Run Default Audit Job (CLI)" but workflow no longer creates audit jobs. Consider "Run Default Audit (CLI)" or "Run Default Audit with CLI".

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-default-job-cli-easy/instruction.md` at line 1,
Update the document title in instruction.md by replacing the current heading
text "Run Default Audit Job (CLI)" with a title that reflects the updated
workflow (suggestions: "Run Default Audit (CLI)" or "Run Default Audit with
CLI"); ensure the H1 heading line at the top of the file is changed accordingly
so the file's title matches the current behavior.
tests/agentic-use/auditor-default-job-cli/instruction.md (1)

1-1: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update title to match current workflow.

Title says "Run Default Audit Job (CLI)" but workflow no longer creates audit jobs. Consider "Run Default Audit (CLI)" or "Run Default Audit with CLI".

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-default-job-cli/instruction.md` at line 1, Update
the markdown title string "Run Default Audit Job (CLI)" to reflect the current
workflow that no longer creates audit jobs—replace it with a clearer title such
as "Run Default Audit (CLI)" or "Run Default Audit with CLI" by editing the
top-level heading in instruction.md (the line containing "Run Default Audit Job
(CLI)"); ensure the new title remains a top-level heading (prefixed with "# ")
and matches other documentation naming conventions.
🧹 Nitpick comments (6)
web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.spec.ts (1)

463-467: ⚡ Quick win

Test does not enforce the required auditor run command.

Line 463-467 should also assert suggested_actions includes nemo auditor audit run --spec so the migrated workflow contract is covered.

Proposed test update
     expect(newModel?.suggested_actions?.[0]).toContain('nemo auditor targets create');
     expect(newModel?.suggested_actions?.[0]).toContain('"model": "new-model-7b"');
+    expect(
+      newModel?.suggested_actions?.some((a) => a.includes('nemo auditor audit run --spec'))
+    ).toBe(true);
     expect(newModel?.suggested_actions?.[1]).toContain(
       'nemo evaluation jobs create --model new-model-7b'
     );
🤖 Prompt for 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.

In `@web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.spec.ts`
around lines 463 - 467, The test is missing an assertion that the migrated
model's suggested_actions includes the required auditor run command; update the
spec in utils.spec.ts to assert that newModel?.suggested_actions contains the
string "nemo auditor audit run --spec" (e.g., add
expect(newModel?.suggested_actions).toContain('nemo auditor audit run --spec')
or expect(newModel?.suggested_actions?.[2]).toContain('nemo auditor audit run
--spec') alongside the existing checks against newModel and suggested_actions).
tests/agentic-use/auditor-default-job-cli-easy/tests/test_outputs.py (1)

50-61: 💤 Low value

Add explicit return type annotations.

Test functions lack -> None return type annotations. Per coding guidelines, always use concrete type hints.

Also applies to: 67-77, 83-92, 95-110

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-default-job-cli-easy/tests/test_outputs.py` around
lines 50 - 61, Several test functions (e.g., test_audit_target_exists,
test_audit_target_model and the other tests around lines 67-77, 83-92, 95-110)
are missing explicit return type annotations; update each test function
signature to include the concrete return type "-> None". Locate the functions by
their names (test_audit_target_exists, test_audit_target_model, and the other
test_* functions mentioned) and add "-> None" to their defs so all tests conform
to the project's typing guideline.

Source: Coding guidelines

tests/agentic-use/auditor-default-job-cli/instruction.md (1)

13-27: ⚡ Quick win

Consider adding CLI command examples.

Other instruction variants (auditor-default-job-cli-easy and auditor-custom-probes-cli) provide concrete CLI command examples. This variant only lists high-level steps without showing commands. Per coding guidelines, use concrete examples with real commands.

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-default-job-cli/instruction.md` around lines 13 -
27, Add concrete nmp CLI command examples showing how to create the audit target
named audit-target (referencing model aws/anthropic/bedrock-claude-sonnet-4-5-v1
via provider nvidia-inference), how to create the audit config named default
with representative flags/options, and how to invoke the audit run using the
default config and audit-target; include the exact nmp subcommands and arguments
(e.g., create-target/create-config/run or the project’s equivalent) so reviewers
can copy-paste and verify that audit-target and default are created and that the
audit run command is executed with both.

Source: Coding guidelines

tests/agentic-use/auditor-custom-probes-cli/tests/test_outputs.py (1)

53-57: 💤 Low value

Add explicit return type annotations.

Test functions lack -> None return type annotations. Per coding guidelines, always use concrete type hints.

Example fix
-def test_audit_target_exists(client: NeMoPlatform):
+def test_audit_target_exists(client: NeMoPlatform) -> None:

Also applies to: 60-64, 70-74, 77-82, 102-112, 117-133, 146-162, 164-179

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-custom-probes-cli/tests/test_outputs.py` around
lines 53 - 57, Several test functions are missing explicit return type
annotations; update each test function (e.g., test_audit_target_exists and the
other test functions in the ranges referenced) to include an explicit "-> None"
return type. Locate each top-level test function definition (def test_*(...):)
and change the signature to add "-> None" before the colon so all tests follow
the concrete type-hint guideline.

Source: Coding guidelines

tests/agentic-use/auditor-custom-probes-cli/README.md (1)

21-22: 💤 Low value

Optional: Avoid word repetition.

"right probes" and "right model" in close proximity. Consider "correct model" or "expected model".

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-custom-probes-cli/README.md` around lines 21 - 22,
The sentence under the "Setup correctness" bullet uses repeated wording ("right
probes" and "right model"); edit that bullet (the "Setup correctness" line) to
replace one or both instances with alternatives such as "correct probes" or
"expected model" so the phrase reads smoothly (for example: "config has the
correct probes, target references the expected model, and the audit command
references both config + target").
tests/agentic-use/auditor-default-job-cli/tests/test_outputs.py (1)

50-61: 💤 Low value

Add explicit return type annotations.

Test functions lack -> None return type annotations. Per coding guidelines, always use concrete type hints.

Also applies to: 67-77, 83-92, 95-110

🤖 Prompt for 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.

In `@tests/agentic-use/auditor-default-job-cli/tests/test_outputs.py` around lines
50 - 61, Add explicit return type annotations "-> None" to the test functions;
specifically update the signatures of test_audit_target_exists and
test_audit_target_model (and any other test_... functions in this test file
noted by the reviewer) to include "-> None" so they read e.g. def
test_audit_target_exists(client: NeMoPlatform) -> None: and def
test_audit_target_model(client: NeMoPlatform) -> None:.

Source: Coding guidelines

🤖 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 `@web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.ts`:
- Around line 371-374: The suggested_actions array in utils.ts for the new-model
suggestion flow is missing the audit execution step; update the
suggested_actions entry (the array named suggested_actions) to include a nemo
auditor audit run --spec command (using the appropriate spec or placeholder tied
to the created target/model) so the workflow runs the audit after creating the
target (e.g. insert a `nemo auditor audit run --spec <spec>`-style command in
the array, placed after the target creation entry and before or alongside the
evaluation jobs entry) to ensure audits are executed as part of the migrated
flow.

---

Outside diff comments:
In `@tests/agentic-use/auditor-default-job-cli-easy/instruction.md`:
- Line 1: Update the document title in instruction.md by replacing the current
heading text "Run Default Audit Job (CLI)" with a title that reflects the
updated workflow (suggestions: "Run Default Audit (CLI)" or "Run Default Audit
with CLI"); ensure the H1 heading line at the top of the file is changed
accordingly so the file's title matches the current behavior.

In `@tests/agentic-use/auditor-default-job-cli/instruction.md`:
- Line 1: Update the markdown title string "Run Default Audit Job (CLI)" to
reflect the current workflow that no longer creates audit jobs—replace it with a
clearer title such as "Run Default Audit (CLI)" or "Run Default Audit with CLI"
by editing the top-level heading in instruction.md (the line containing "Run
Default Audit Job (CLI)"); ensure the new title remains a top-level heading
(prefixed with "# ") and matches other documentation naming conventions.

---

Nitpick comments:
In `@tests/agentic-use/auditor-custom-probes-cli/README.md`:
- Around line 21-22: The sentence under the "Setup correctness" bullet uses
repeated wording ("right probes" and "right model"); edit that bullet (the
"Setup correctness" line) to replace one or both instances with alternatives
such as "correct probes" or "expected model" so the phrase reads smoothly (for
example: "config has the correct probes, target references the expected model,
and the audit command references both config + target").

In `@tests/agentic-use/auditor-custom-probes-cli/tests/test_outputs.py`:
- Around line 53-57: Several test functions are missing explicit return type
annotations; update each test function (e.g., test_audit_target_exists and the
other test functions in the ranges referenced) to include an explicit "-> None"
return type. Locate each top-level test function definition (def test_*(...):)
and change the signature to add "-> None" before the colon so all tests follow
the concrete type-hint guideline.

In `@tests/agentic-use/auditor-default-job-cli-easy/tests/test_outputs.py`:
- Around line 50-61: Several test functions (e.g., test_audit_target_exists,
test_audit_target_model and the other tests around lines 67-77, 83-92, 95-110)
are missing explicit return type annotations; update each test function
signature to include the concrete return type "-> None". Locate the functions by
their names (test_audit_target_exists, test_audit_target_model, and the other
test_* functions mentioned) and add "-> None" to their defs so all tests conform
to the project's typing guideline.

In `@tests/agentic-use/auditor-default-job-cli/instruction.md`:
- Around line 13-27: Add concrete nmp CLI command examples showing how to create
the audit target named audit-target (referencing model
aws/anthropic/bedrock-claude-sonnet-4-5-v1 via provider nvidia-inference), how
to create the audit config named default with representative flags/options, and
how to invoke the audit run using the default config and audit-target; include
the exact nmp subcommands and arguments (e.g., create-target/create-config/run
or the project’s equivalent) so reviewers can copy-paste and verify that
audit-target and default are created and that the audit run command is executed
with both.

In `@tests/agentic-use/auditor-default-job-cli/tests/test_outputs.py`:
- Around line 50-61: Add explicit return type annotations "-> None" to the test
functions; specifically update the signatures of test_audit_target_exists and
test_audit_target_model (and any other test_... functions in this test file
noted by the reviewer) to include "-> None" so they read e.g. def
test_audit_target_exists(client: NeMoPlatform) -> None: and def
test_audit_target_model(client: NeMoPlatform) -> None:.

In `@web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.spec.ts`:
- Around line 463-467: The test is missing an assertion that the migrated
model's suggested_actions includes the required auditor run command; update the
spec in utils.spec.ts to assert that newModel?.suggested_actions contains the
string "nemo auditor audit run --spec" (e.g., add
expect(newModel?.suggested_actions).toContain('nemo auditor audit run --spec')
or expect(newModel?.suggested_actions?.[2]).toContain('nemo auditor audit run
--spec') alongside the existing checks against newModel and suggested_actions).
🪄 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: ff1efd7b-e31e-4d1f-8525-605e5b383771

📥 Commits

Reviewing files that changed from the base of the PR and between 892ebce and 2eb966a.

⛔ Files ignored due to path filters (2)
  • sdk/python/nemo-platform/README.md is excluded by !sdk/**
  • sdk/python/overrides/nemo-platform/README/03_usage.md is excluded by !sdk/**
📒 Files selected for processing (11)
  • plugins/nemo-agents/src/nemo_agents_plugin/skills/agents-optimize/SKILL.md
  • pytest.ini
  • tests/agentic-use/auditor-custom-probes-cli/README.md
  • tests/agentic-use/auditor-custom-probes-cli/instruction.md
  • tests/agentic-use/auditor-custom-probes-cli/tests/test_outputs.py
  • tests/agentic-use/auditor-default-job-cli-easy/instruction.md
  • tests/agentic-use/auditor-default-job-cli-easy/tests/test_outputs.py
  • tests/agentic-use/auditor-default-job-cli/instruction.md
  • tests/agentic-use/auditor-default-job-cli/tests/test_outputs.py
  • web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.spec.ts
  • web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.ts
💤 Files with no reviewable changes (1)
  • pytest.ini

@anastasia-nesterenko anastasia-nesterenko changed the title Fix(auditor): Update auditor usages fix(auditor): Update auditor usages Jun 9, 2026

@tylersbray tylersbray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I did a pass with an AI code review, there were two things that popped out:

  1. Run at least one updated task in Harbor (e.g. auditor-default-job-cli-easy) to confirm:
  • client.auditor.* calls succeed against the eval container API
  • Agents following new instructions pass the verifier
  1. Could be a little tighter in auditor-default-job-cli-easy/tests/test_outputs.py. There is this snippet:
has_audit_run = any(
    all(p in cmd for p in ["auditor", "audit", "run", CONFIG_NAME, TARGET_NAME])
    for cmd in commands
)

It quibbled about these issues:

  • CONFIG_NAME = "default" is an extremely common substring — can false-pass on unrelated commands containing "default".
  • No _has_token() — custom-probes task uses word-boundary regex; default-job does not.
  • Does not verify qualified spec — instructions say default/audit-target; test only checks bare name substrings.
  • No target-create trajectory check — only config interaction is trajectory-tested.

Recommendation: Port _has_token() from custom-probes and require audit-target + either default/audit-target or default/default in the run command.

I'm not sure how set up harbor is at this point, I think we were waiting on some NAT changes at one point? Tightening up the tests might be good to do a little more than just look for strings.

Signed-off-by: anastasia-nesterenko <anesterenko@nvidia.com>
@anastasia-nesterenko
anastasia-nesterenko added this pull request to the merge queue Jun 10, 2026
Merged via the queue into main with commit 39b6c19 Jun 10, 2026
39 checks passed
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.

2 participants