Skip to content

feat(experiments): Add new fields to support Optimization team#540

Merged
shanaiabuggy merged 3 commits into
mainfrom
sbuggy/eng-441
Jul 1, 2026
Merged

feat(experiments): Add new fields to support Optimization team#540
shanaiabuggy merged 3 commits into
mainfrom
sbuggy/eng-441

Conversation

@shanaiabuggy

@shanaiabuggy shanaiabuggy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Experiment groups can now include an insight ID, summary, and free-form metadata.
    • Experiments can now include a parent experiment ID, lifecycle status, and root cause.
  • Bug Fixes
    • Requests with an invalid parent experiment reference are rejected with HTTP 400.
    • The new fields are preserved on create and update.
  • Tests
    • Added coverage for round-tripping the new fields, optional/null defaults, parent validation, and free-form status updates.

@shanaiabuggy
shanaiabuggy requested review from a team as code owners July 1, 2026 20:13
@github-actions github-actions Bot added the feat label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 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: cd357fa9-02f5-4689-aac4-1190459fc293

📥 Commits

Reviewing files that changed from the base of the PR and between 3a3ecc1 and 27683ea.

⛔ Files ignored due to path filters (9)
  • sdk/python/nemo-platform/.nmpcontext/openapi.yaml is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/resources/experiment_groups/experiment_groups.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/resources/experiments/experiments.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiment_groups/experiment_group_create_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiment_groups/experiment_group_update_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_create_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_response.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_update_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/tests/api_resources/test_experiments.py is excluded by !sdk/**
📒 Files selected for processing (1)
  • services/intake/src/nmp/intake/api/v2/experiments/endpoints.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/intake/src/nmp/intake/api/v2/experiments/endpoints.py

📝 Walkthrough

Walkthrough

Adds optional lineage, status, and metadata fields to experiment and experiment-group models, propagates them through intake request/response schemas and endpoints, mirrors them in OpenAPI, and adds tests for round-trip, validation, and default-null behavior.

Changes

Experiment evaluator fields

Layer / File(s) Summary
Entity model updates
services/intake/src/nmp/intake/entities/experiments.py
ExperimentGroup gains insight_id, summary, metadata; Experiment gains parent_experiment_id, status, root_cause.
API schema updates
services/intake/src/nmp/intake/api/v2/experiments/schemas.py
Request/response schemas expose the new fields and map them from entities.
Endpoint persistence wiring
services/intake/src/nmp/intake/api/v2/experiments/endpoints.py
Create/update handlers persist the new fields; parent references are validated before create/update.
OpenAPI and tests
openapi/ga/individual/platform.openapi.yaml, openapi/ga/openapi.yaml, openapi/openapi.yaml, services/intake/tests/test_experiment_optimization_fields.py
OpenAPI schemas and tests cover the new fields, parent validation, free-form status, updates, and omitted-field defaults.

Possibly related PRs

Suggested reviewers: BrianNewsom

🚥 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 is concise and accurately reflects the main change: adding new experiment fields for the Optimization team.
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.
✨ 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 sbuggy/eng-441

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.

🧹 Nitpick comments (1)
services/intake/tests/test_experiment_evaluator_fields.py (1)

19-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing group-update round-trip test.

Experiment fields get an update-path test (line 60-78) but group fields (insight_id/summary/metadata) only cover create. Add a PUT test for parity.

🤖 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 `@services/intake/tests/test_experiment_evaluator_fields.py` around lines 19 -
28, Add a missing update-path round-trip test for group evaluator fields in
test_group_evaluator_fields_round_trip’s area: after the create assertion,
exercise the groups update endpoint with a PUT on the created group and verify
insight_id, summary, and metadata are preserved/returned just like the
experiment update test does. Use the existing GROUPS client flow and the same
field names so the test covers both create and update parity.
🤖 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.

Nitpick comments:
In `@services/intake/tests/test_experiment_evaluator_fields.py`:
- Around line 19-28: Add a missing update-path round-trip test for group
evaluator fields in test_group_evaluator_fields_round_trip’s area: after the
create assertion, exercise the groups update endpoint with a PUT on the created
group and verify insight_id, summary, and metadata are preserved/returned just
like the experiment update test does. Use the existing GROUPS client flow and
the same field names so the test covers both create and update parity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 47f4425a-c99f-45e8-b6a0-24fe2d92d860

📥 Commits

Reviewing files that changed from the base of the PR and between 99604c5 and 75869da.

⛔ Files ignored due to path filters (16)
  • sdk/python/nemo-platform/.nmpcontext/openapi.yaml is excluded by !sdk/**
  • sdk/python/nemo-platform/.nmpcontext/stainless.yaml is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/resources/experiment_groups/experiment_groups.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/resources/experiments/api.md is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/resources/experiments/experiments.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiment_groups/experiment_group_create_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiment_groups/experiment_group_response.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiment_groups/experiment_group_update_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/__init__.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_create_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_response.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_status.py is excluded by !sdk/**
  • sdk/python/nemo-platform/src/nemo_platform/types/experiments/experiment_update_params.py is excluded by !sdk/**
  • sdk/python/nemo-platform/tests/api_resources/test_experiment_groups.py is excluded by !sdk/**
  • sdk/python/nemo-platform/tests/api_resources/test_experiments.py is excluded by !sdk/**
  • sdk/stainless.yaml is excluded by !sdk/**
📒 Files selected for processing (7)
  • openapi/ga/individual/platform.openapi.yaml
  • openapi/ga/openapi.yaml
  • openapi/openapi.yaml
  • services/intake/src/nmp/intake/api/v2/experiments/endpoints.py
  • services/intake/src/nmp/intake/api/v2/experiments/schemas.py
  • services/intake/src/nmp/intake/entities/experiments.py
  • services/intake/tests/test_experiment_evaluator_fields.py

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 22513/29630 76.0% 60.9%
Integration Tests 13005/28310 45.9% 19.4%

@shanaiabuggy shanaiabuggy changed the title feat(experiments): Add new fields to support NeMo Evaluator feat(experiments): Add new fields to support Experimentalist team Jul 1, 2026
@shanaiabuggy shanaiabuggy changed the title feat(experiments): Add new fields to support Experimentalist team feat(experiments): Add new fields to support Optimization team Jul 1, 2026
Comment thread services/intake/src/nmp/intake/entities/experiments.py Outdated
Comment thread services/intake/src/nmp/intake/entities/experiments.py Outdated
Comment thread services/intake/src/nmp/intake/api/v2/experiments/schemas.py

@BrianNewsom BrianNewsom 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.

Approved after changes discussed live!

Signed-off-by: shanaiabuggy <[email protected]>
Signed-off-by: shanaiabuggy <[email protected]>
@shanaiabuggy
shanaiabuggy enabled auto-merge July 1, 2026 23:28
@shanaiabuggy
shanaiabuggy added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 9aa4f5c Jul 1, 2026
54 checks passed
@shanaiabuggy
shanaiabuggy deleted the sbuggy/eng-441 branch July 1, 2026 23:43
arpitsardhana pushed a commit that referenced this pull request Jul 9, 2026
* feat(experiments): Add new fields to support NeMo Evaluator

Signed-off-by: shanaiabuggy <[email protected]>

* pr comments

Signed-off-by: shanaiabuggy <[email protected]>

* lint

Signed-off-by: shanaiabuggy <[email protected]>

---------

Signed-off-by: shanaiabuggy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants