Skip to content

default to writing insights to platform - #1054

Open
jeremysilva1098 wants to merge 3 commits into
mainfrom
ASE-728-default-write-insights/jesilva
Open

default to writing insights to platform#1054
jeremysilva1098 wants to merge 3 commits into
mainfrom
ASE-728-default-write-insights/jesilva

Conversation

@jeremysilva1098

@jeremysilva1098 jeremysilva1098 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

nemo agents analyst run (and its alias nemo insights analyze) now always persists insights to the platform. Previously, discovering an optimizer.yaml profile silently diverted all insight writes to a local /.nemo-optimizer/insights.yaml and skipped the platform entirely — so the common flag-free invocation from an agent directory never populated the Insights API or the Studio insights tab.

--insights-file-output is now purely additive: it mirrors what the platform stored into a local file. There is no longer any flag combination that keeps insights off the platform.

Behavior

┌─────────────────────────────────────────────┬────────────────────┬────────────┐
│ Command │ Platform │ Local file │
├─────────────────────────────────────────────┼────────────────────┼────────────┤
│ analyst run │ ✅ │ — │
├─────────────────────────────────────────────┼────────────────────┼────────────┤
│ analyst run --insights-file-output out.yaml │ ✅ (written first) │ ✅ mirror │
└─────────────────────────────────────────────┴────────────────────┴────────────┘

Mirroring: platform is the source of truth

The platform is written first, and the file receives the rows it returned — platform-assigned ids, name, and timestamps included.

That ordering is what makes the mirror correct across runs. The analyst's change-set keys updates by insight id (AnalystResult.updated_insights[].id), and list_insights reads from the platform. Had the two stores been written independently, each would mint its own ids, every subsequent update would carry an id the file had never seen, and the mirror would degrade into a create-only log that silently diverges. test_mirror_updates_match_platform_ids_across_runs guards this directly.

A mirror write that fails (unwritable path, bad permissions) is reported as a warning on the run report rather than exiting non-zero — the platform writes have already landed, so failing the run would misreport what happened.

Changes

  • analyst_backend.py: RemoteAnalystBackend takes an optional mirror and writes it after the platform (_mirror, _insight_to_record). File I/O extracted into a shared InsightsFileStore (read/write/upsert-merge) so the local backend and the mirror can't drift on document shape, UTF-8 handling, or the preserve-other-top-level-keys rule.
  • cli.py: removed the implicit profile-derived local default; --insights-file-output re-documented as a mirror.
  • run.py / deps.py / jobs/analyze.py: docstrings and the AnalyzeSpec field description follow. Scheduled runs already passed insights_output=None and are unaffected.
  • READMEs for nemo-insights and nemo-experimentalist, plus the .nemo-optimizer/ contract note in the experimentalist AGENTS.md.

Note on LocalAnalystBackend

The class and the local_only argument on make_analyst_backend / run_analyst are retained as maintainer plumbing for the insights testbed only — no CLI flag or job field reaches them, and all three docstrings say so.

The testbed genuinely needs file-only persistence: it treats the YAML as the artifact under test (checked into testbed/insights/.yaml, hashed as insights_sha256, diffed across runs, promoted by atomic swap), --update-insights seeds a run by listing priors from that file, and the glamr subject targets an external Intake behind basic auth that does not host the Insights plugin API at all.

Summary by CodeRabbit

  • New Features

    • Insights are now saved on the platform by default.
    • Optionally mirror platform Insights, including IDs and timestamps, to a local YAML file.
    • Added local-only analysis mode for workflows that require file-based storage.
    • Mirrored results merge across runs while preserving existing records.
  • Bug Fixes

    • Local mirror write failures now produce warnings without blocking successful platform saves.
  • Documentation

    • Updated CLI help and workflow guidance to reflect platform-first Insight storage.

@jeremysilva1098
jeremysilva1098 requested review from a team as code owners August 3, 2026 22:22
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 83c0f97f-3283-4805-a0a8-94628c8d9263

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1033a and d689d1e.

📒 Files selected for processing (14)
  • docs/agents/insight-driven-optimization.mdx
  • plugins/nemo-experimentalist/AGENTS.md
  • plugins/nemo-experimentalist/README.md
  • plugins/nemo-insights/README.md
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py
  • plugins/nemo-insights/src/nemo_insights_plugin/cli.py
  • plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py
  • plugins/nemo-insights/testbed/adapters.py
  • plugins/nemo-insights/tests/test_analyst_run.py
  • plugins/nemo-insights/tests/test_cli_profile.py
  • plugins/nemo-insights/tests/test_periodic_analysis.py
  • plugins/nemo-insights/tests/testbed/test_adapters.py
🚧 Files skipped from review as they are similar to previous changes (13)
  • plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py
  • plugins/nemo-experimentalist/AGENTS.md
  • plugins/nemo-experimentalist/README.md
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py
  • plugins/nemo-insights/tests/testbed/test_adapters.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.py
  • plugins/nemo-insights/testbed/adapters.py
  • plugins/nemo-insights/README.md
  • plugins/nemo-insights/tests/test_analyst_run.py
  • plugins/nemo-insights/tests/test_cli_profile.py
  • plugins/nemo-insights/tests/test_periodic_analysis.py
  • plugins/nemo-insights/src/nemo_insights_plugin/cli.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py

📝 Walkthrough

Walkthrough

nemo insights analyze now persists insights on Platform by default and optionally mirrors them to YAML. Explicit --local-only mode writes directly to YAML. Backend selection, CLI validation, adapters, tests, and documentation support both modes.

Changes

Insights persistence workflow

Layer / File(s) Summary
Shared store and backend persistence
plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
InsightsFileStore manages YAML records and workspace/ID upserts. Remote persistence mirrors Platform insights and warns on mirror failures. Local persistence uses independently generated IDs.
Backend mode and CLI propagation
plugins/nemo-insights/src/nemo_insights_plugin/analyst/{deps.py,run.py}, plugins/nemo-insights/src/nemo_insights_plugin/{cli.py,jobs/analyze.py}, plugins/nemo-insights/testbed/adapters.py
The CLI validates only explicit output paths. run_analyst forwards local_only to backend selection. Testbed adapters use local-only mode.
Persistence and mode validation
plugins/nemo-insights/tests/*
Tests cover Platform persistence, YAML mirroring, cross-run updates, mirror failures, backend selection, output validation, and adapter propagation.
Insights workflow documentation
docs/agents/insight-driven-optimization.mdx, plugins/nemo-experimentalist/{AGENTS.md,README.md}, plugins/nemo-insights/README.md
Documentation describes Platform persistence, optional YAML mirroring, merge behavior, mirror failures, and Experimentalist file consumption.

Sequence Diagram(s)

sequenceDiagram
  participant AnalystCLI
  participant run_analyst
  participant PlatformInsights
  participant InsightsFileStore
  AnalystCLI->>run_analyst: pass insights_output and local_only
  run_analyst->>PlatformInsights: persist insight in platform mode
  PlatformInsights-->>run_analyst: return platform insight
  run_analyst->>InsightsFileStore: mirror platform record
  InsightsFileStore-->>run_analyst: warn on mirror failure
Loading

Possibly related PRs

Suggested labels: feat, docs

Suggested reviewers: aleckhoury, svvarom

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 PR's primary change: platform persistence becomes the default for insights.
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.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ASE-728-default-write-insights/jesilva

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

@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: 3

🧹 Nitpick comments (3)
plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py (1)

339-411: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use concrete types for insight records.

The new storage API uses bare dict and list[dict]. Define an InsightRecord TypedDict, then use it for records and store methods.

As per coding guidelines, “Prefer concrete type hints over string-based type hints.”

🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py`
around lines 339 - 411, Define an InsightRecord TypedDict for the serialized
insight fields used by _record_to_insight and _insight_to_record, then replace
bare dict and list[dict] annotations with InsightRecord and list[InsightRecord]
throughout InsightsFileStore and the conversion helpers. Keep optional or
nullable fields aligned with the actual record values and avoid string-based
type hints.

Source: Coding guidelines

plugins/nemo-insights/tests/test_analyst_run.py (1)

24-26: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert both local_only modes.

The stub records local_only, but test_injected_client_is_used_and_closed never checks it. This file also has no local_only=True call. A regression could drop the forwarding or force False and still pass. Assert the default False value and add a true-mode test with insights_output.

🤖 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 `@plugins/nemo-insights/tests/test_analyst_run.py` around lines 24 - 26, Update
fake_make_backend and the analyst tests so local_only forwarding is verified in
both modes: assert test_injected_client_is_used_and_closed uses the default
False value, and add a test invoking the flow with local_only=True and an
insights_output value, confirming the stub observes True and the injected client
behavior remains correct.
plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py (1)

62-64: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Validate local_only with insights_output before serialization. AnalyzeSpec accepts local_only=True without insights_output, and AnalyzeJob.compile serializes the invalid spec. The error occurs later in make_analyst_backend. Add cross-field validation at the spec or compile boundary and cover invalid compilation with a targeted job test.

🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py` around lines
62 - 64, Add cross-field validation for AnalyzeSpec.local_only and
insights_output so local_only=True without insights_output is rejected before
serialization or backend creation. Enforce this at the AnalyzeSpec validation or
AnalyzeJob.compile boundary, preserving valid configurations, and add a targeted
job test confirming invalid compilation fails.
🤖 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 `@plugins/nemo-experimentalist/README.md`:
- Around line 45-48: Update the Experimentalist output documentation to state
that combining --local-only with --insights-file-output writes to the explicitly
provided path, while .nemo-optimizer/insights.yaml is used only when
--insights-file-output is omitted.

In `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py`:
- Around line 391-411: Update the store methods around write_records and merge
in plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
lines 391-411 to serialize the complete read-modify-write merge transaction with
a file lock, and write via a temporary file followed by atomic replacement.
Update the local-only mutation flow around lines 577-612 to use this same locked
store transaction; both sites require changes so concurrent analysts cannot
overwrite each other’s records.
- Around line 385-389: Update AnalystBackend.read_records to validate that the
YAML document is a mapping, that insights is a non-null list, and that every
entry is a record before returning it; reject malformed shapes with a clear
validation error. In _mirror, catch these read/validation failures and emit a
mirror warning instead of allowing a successful platform write to fail.

---

Nitpick comments:
In `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py`:
- Around line 339-411: Define an InsightRecord TypedDict for the serialized
insight fields used by _record_to_insight and _insight_to_record, then replace
bare dict and list[dict] annotations with InsightRecord and list[InsightRecord]
throughout InsightsFileStore and the conversion helpers. Keep optional or
nullable fields aligned with the actual record values and avoid string-based
type hints.

In `@plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py`:
- Around line 62-64: Add cross-field validation for AnalyzeSpec.local_only and
insights_output so local_only=True without insights_output is rejected before
serialization or backend creation. Enforce this at the AnalyzeSpec validation or
AnalyzeJob.compile boundary, preserving valid configurations, and add a targeted
job test confirming invalid compilation fails.

In `@plugins/nemo-insights/tests/test_analyst_run.py`:
- Around line 24-26: Update fake_make_backend and the analyst tests so
local_only forwarding is verified in both modes: assert
test_injected_client_is_used_and_closed uses the default False value, and add a
test invoking the flow with local_only=True and an insights_output value,
confirming the stub observes True and the injected client behavior remains
correct.
🪄 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: 5ddd8ef8-54ea-4f62-8aab-51568c73b2d2

📥 Commits

Reviewing files that changed from the base of the PR and between 383d8de and 215bfb5.

📒 Files selected for processing (13)
  • plugins/nemo-experimentalist/AGENTS.md
  • plugins/nemo-experimentalist/README.md
  • plugins/nemo-insights/README.md
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py
  • plugins/nemo-insights/src/nemo_insights_plugin/cli.py
  • plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py
  • plugins/nemo-insights/testbed/adapters.py
  • plugins/nemo-insights/tests/test_analyst_run.py
  • plugins/nemo-insights/tests/test_cli_profile.py
  • plugins/nemo-insights/tests/test_periodic_analysis.py
  • plugins/nemo-insights/tests/testbed/test_adapters.py

Comment thread plugins/nemo-experimentalist/README.md Outdated
Comment on lines +45 to +48
documented trace, workspace, and output options. It persists an Insight on
Platform by default and reports its ID; `--insights-file-output` additionally
mirrors those rows into a local file, and `--local-only` writes the local
profile default, `.nemo-optimizer/insights.yaml`, and nothing else. The Experimentalist does not analyze traces,

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the explicit local-only output path.

--local-only --insights-file-output <path> writes to <path>, not the profile default. State that .nemo-optimizer/insights.yaml is used only when --insights-file-output is omitted.

🤖 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 `@plugins/nemo-experimentalist/README.md` around lines 45 - 48, Update the
Experimentalist output documentation to state that combining --local-only with
--insights-file-output writes to the explicitly provided path, while
.nemo-optimizer/insights.yaml is used only when --insights-file-output is
omitted.

Comment on lines +385 to +389
def read_records(self) -> list[dict]:
if not self.path.exists():
return []
raw = yaml.safe_load(self.path.read_text(encoding="utf-8")) or {}
return list(raw.get("insights", []))

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Prevent malformed mirror files from failing completed platform writes.

read_records() raises AttributeError or TypeError for a YAML list, scalar, insights: null, or non-record entries. _mirror() does not catch those errors. The platform write can succeed, but the run then fails instead of reporting a mirror warning.

Validate the document shape. In mirror mode, convert these validation failures into warnings.

🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py`
around lines 385 - 389, Update AnalystBackend.read_records to validate that the
YAML document is a mapping, that insights is a non-null list, and that every
entry is a record before returning it; reject malformed shapes with a clear
validation error. In _mirror, catch these read/validation failures and emit a
mirror warning instead of allowing a successful platform write to fail.

Comment on lines +391 to +411
def write_records(self, records: list[dict]) -> None:
self.path.parent.mkdir(parents=True, exist_ok=True)
document = yaml.safe_load(self.path.read_text(encoding="utf-8")) if self.path.exists() else None
if not isinstance(document, dict):
document = {}
document["insights"] = records
self.path.write_text(yaml.safe_dump(document, sort_keys=False, allow_unicode=True), encoding="utf-8")

def merge(self, records: list[dict]) -> None:
"""Upsert *records* by ``(workspace, id)`` into the existing document."""
existing = self.read_records()
index = {(r.get("workspace"), r.get("id")): position for position, r in enumerate(existing)}
for record in records:
key = (record.get("workspace"), record.get("id"))
position = index.get(key)
if position is None:
index[key] = len(existing)
existing.append(record)
else:
existing[position] = record
self.write_records(existing)

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.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Serialize YAML read-modify-write operations.

Two analysts targeting one file can read the same state and then overwrite each other’s records. This loses local-only insights or mirrored platform records.

  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py#L391-L411: lock the complete merge transaction and write through a temporary file with atomic replacement.
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py#L577-L612: route local-only mutations through the same locked store transaction.
📍 Affects 1 file
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py#L391-L411 (this comment)
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py#L577-L612
🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py`
around lines 391 - 411, Update the store methods around write_records and merge
in plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
lines 391-411 to serialize the complete read-modify-write merge transaction with
a file lock, and write via a temporary file followed by atomic replacement.
Update the local-only mutation flow around lines 577-612 to use this same locked
store transaction; both sites require changes so concurrent analysts cannot
overwrite each other’s records.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30415/38444 79.1% 63.8%
Integration Tests 18018/37113 48.5% 21.0%

@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

🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/cli.py`:
- Around line 151-153: Update the mirror setup in the analysis output flow so a
failure from analysis.insights_output.parent.mkdir does not abort run_analyst or
platform persistence. Catch the local directory-creation error and continue with
mirror output disabled, while preserving normal mirror behavior when setup
succeeds.
🪄 Autofix

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: 769f8bc7-900f-4d9f-8223-456f43463ba7

📥 Commits

Reviewing files that changed from the base of the PR and between 215bfb5 and 4d52d69.

📒 Files selected for processing (10)
  • plugins/nemo-experimentalist/AGENTS.md
  • plugins/nemo-experimentalist/README.md
  • plugins/nemo-insights/README.md
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py
  • plugins/nemo-insights/src/nemo_insights_plugin/cli.py
  • plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py
  • plugins/nemo-insights/tests/test_cli_profile.py
  • plugins/nemo-insights/tests/test_periodic_analysis.py
💤 Files with no reviewable changes (1)
  • plugins/nemo-insights/src/nemo_insights_plugin/jobs/analyze.py
🚧 Files skipped from review as they are similar to previous changes (7)
  • plugins/nemo-experimentalist/AGENTS.md
  • plugins/nemo-experimentalist/README.md
  • plugins/nemo-insights/tests/test_periodic_analysis.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/run.py
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/deps.py
  • plugins/nemo-insights/README.md
  • plugins/nemo-insights/src/nemo_insights_plugin/analyst/analyst_backend.py

Comment on lines +151 to +153
if analysis.insights_output is not None:
analysis.insights_output.parent.mkdir(parents=True, exist_ok=True)
typer.echo(f"Insights file (mirror of the platform): {analysis.insights_output}", err=True)

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep mirror setup from blocking platform persistence.

If the mirror parent cannot be created, parent.mkdir(...) raises before run_analyst. The outer handler then exits with code 1, so the platform write never occurs. Catch this local setup failure and continue without the mirror, or move directory setup into the backend’s warning-only mirror path.

🤖 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 `@plugins/nemo-insights/src/nemo_insights_plugin/cli.py` around lines 151 -
153, Update the mirror setup in the analysis output flow so a failure from
analysis.insights_output.parent.mkdir does not abort run_analyst or platform
persistence. Catch the local directory-creation error and continue with mirror
output disabled, while preserving normal mirror behavior when setup succeeds.

Signed-off-by: Jeremy Silva <jesilva@nvidia.com>
Insights always go to the platform now; --insights-file-output only ever
mirrors what was stored. Review concluded that a fully local persistence
mode is not something users should be choosing between.

LocalAnalystBackend stays as maintainer plumbing for the insights testbed,
which treats the YAML as the artifact under test (checked in, hashed,
diffed) and analyzes subjects such as glamr that expose Intake but not the
Insights plugin. No CLI flag reaches it.

Signed-off-by: Jeremy Silva <jesilva@nvidia.com>
…guide

The flag table still described the removed behavior, where a discovered
profile diverted Insight writes to a local file instead of the platform.

Signed-off-by: Jeremy Silva <jesilva@nvidia.com>
@jeremysilva1098
jeremysilva1098 force-pushed the ASE-728-default-write-insights/jesilva branch from 4d52d69 to d689d1e Compare August 4, 2026 23:33
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

1 participant