Skip to content

feat: Add consolidation, comparison, report modules and orchestrator wiring - #315

Merged
asamal4 merged 1 commit into
lightspeed-core:mainfrom
asamal4:nxm-consolidation-wiring
Aug 11, 2026
Merged

feat: Add consolidation, comparison, report modules and orchestrator wiring#315
asamal4 merged 1 commit into
lightspeed-core:mainfrom
asamal4:nxm-consolidation-wiring

Conversation

@asamal4

@asamal4 asamal4 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Description

Initial wiring of NxM consolidation and comparison reporting.
More statistical comparison will be done in follow up PRs with reporting enhancements

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Unit tests improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: Claude

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added behavioral evaluation reports with consolidated agent results, metadata, rankings, and pairwise comparisons.
    • Reports are saved as formatted JSON files in the evaluation output directory.
    • Comparisons include pass rate, latency, token usage, shared metric scores, and conversation-count differences.
    • Reports now include agent and judge token totals, average token counts, and per-metric result counts.
  • Bug Fixes
    • Report-generation errors are logged without interrupting completed evaluations.
  • Tests
    • Added coverage for comparisons, rankings, report creation, serialization, and single-agent scenarios.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 10fabd39-8444-4cf9-a305-22953c42e3d0

📥 Commits

Reviewing files that changed from the base of the PR and between c1d2ffb and 55b5742.

📒 Files selected for processing (1)
  • src/lightspeed_evaluation/pipeline/behavioral/consolidation.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lightspeed_evaluation/pipeline/behavioral/consolidation.py

Walkthrough

The behavioral pipeline now compares consolidated agents, builds typed evaluation reports, serializes them to eval_report.json, and invokes reporting after completed evaluations.

Changes

Behavioral evaluation reporting

Layer / File(s) Summary
Agent comparison and rankings
src/lightspeed_evaluation/pipeline/behavioral/models.py, src/lightspeed_evaluation/pipeline/behavioral/comparison.py, tests/unit/pipeline/behavioral/test_comparison.py
Adds typed comparison models, pairwise deltas, rankings, shared metric comparisons, and conversation-count difference detection.
Report data preparation
src/lightspeed_evaluation/pipeline/behavioral/consolidation.py
Adds agent and judge token totals, per-run means, uppercase status extraction, and per-metric score counts.
Report construction and persistence
src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py, src/lightspeed_evaluation/pipeline/behavioral/report.py, tests/unit/pipeline/behavioral/test_orchestrator.py, tests/unit/pipeline/behavioral/test_report.py
Loads and consolidates successful runs, compares agents, saves the typed report, and logs report failures without propagating them.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BehavioralOrchestrator
  participant RunDataLoader
  participant Consolidator
  participant AgentComparator
  participant ReportFile
  BehavioralOrchestrator->>RunDataLoader: load successful run data
  RunDataLoader-->>BehavioralOrchestrator: return run data
  BehavioralOrchestrator->>Consolidator: consolidate runs by agent
  Consolidator-->>BehavioralOrchestrator: return consolidated results
  BehavioralOrchestrator->>AgentComparator: compare agents
  AgentComparator-->>BehavioralOrchestrator: return comparison result
  BehavioralOrchestrator->>ReportFile: save eval_report.json
  ReportFile-->>BehavioralOrchestrator: return output path
Loading

Possibly related PRs

Suggested reviewers: xmican10

🚥 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 summarizes the added consolidation, comparison, reporting modules, and orchestrator integration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 2

🤖 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 `@src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py`:
- Around line 431-432: Replace the broad Exception handler in the
report-generation flow with the project-specific error type used for expected
report-generation failures, and remove the inline pylint suppression. Keep the
warning log for that expected error while allowing unexpected programming errors
to propagate.
- Around line 396-434: The orchestration path around _build_and_save_report and
run lacks integration coverage. Add pytest tests using the mocker fixture that
verify successful RunResult values flow through load_run_data, consolidate,
compare_agents, build_report, and save_report, plus a failure-path test
confirming report-generation errors are caught and run() still returns its
evaluation results.
🪄 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: Pro Plus

Run ID: 2c4b3387-46bf-4950-801c-8282adfb9e1e

📥 Commits

Reviewing files that changed from the base of the PR and between 144f63a and ec21899.

📒 Files selected for processing (5)
  • src/lightspeed_evaluation/pipeline/behavioral/comparison.py
  • src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py
  • src/lightspeed_evaluation/pipeline/behavioral/report.py
  • tests/unit/pipeline/behavioral/test_comparison.py
  • tests/unit/pipeline/behavioral/test_report.py

Comment thread src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py
Comment thread src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py Outdated
@asamal4
asamal4 force-pushed the nxm-consolidation-wiring branch 2 times, most recently from ed0ce0e to 68c2bea Compare August 10, 2026 06:57
@asamal4

asamal4 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

bsatapat-jpg
bsatapat-jpg previously approved these changes Aug 10, 2026

@bsatapat-jpg bsatapat-jpg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks

@asamal4
asamal4 force-pushed the nxm-consolidation-wiring branch from 68c2bea to c1d2ffb Compare August 10, 2026 14:47
@asamal4 asamal4 changed the title feat: Add comparison, report modules and wire consolidation into orch… feat: Add comparison, consolidation, report modules and wire into orchestrator wiring Aug 10, 2026
@asamal4 asamal4 changed the title feat: Add comparison, consolidation, report modules and wire into orchestrator wiring feat: Add consolidation, comparison, report modules and orchestrator wiring Aug 10, 2026

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

🤖 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 `@src/lightspeed_evaluation/pipeline/behavioral/consolidation.py`:
- Line 205: Clarify the count semantics in _build_by_metric: since scores
contains per-run mean scores, do not present len(scores) as a raw scored-result
count. Either rename the field to indicate it counts contributing runs or expose
a separate raw-score count, while preserving the aggregated mean calculation.
- Around line 64-77: Update the documentation for the behavioral report payload
in README.md and the relevant docs/ files to explicitly describe
total_agent_tokens, total_judge_tokens, total_embedding_tokens, and the
run-level agent_tokens_mean and judge_tokens_mean fields emitted by
consolidate().
🪄 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: Pro Plus

Run ID: b0223947-6866-439a-bf31-d3708b31c641

📥 Commits

Reviewing files that changed from the base of the PR and between 68c2bea and c1d2ffb.

📒 Files selected for processing (3)
  • src/lightspeed_evaluation/pipeline/behavioral/consolidation.py
  • src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py
  • tests/unit/pipeline/behavioral/test_orchestrator.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/unit/pipeline/behavioral/test_orchestrator.py
  • src/lightspeed_evaluation/pipeline/behavioral/orchestrator.py

Comment thread src/lightspeed_evaluation/pipeline/behavioral/consolidation.py
Comment thread src/lightspeed_evaluation/pipeline/behavioral/consolidation.py Outdated
@asamal4
asamal4 force-pushed the nxm-consolidation-wiring branch from c1d2ffb to 55b5742 Compare August 10, 2026 18:40
@asamal4

asamal4 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bsatapat-jpg bsatapat-jpg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you

@asamal4
asamal4 merged commit 27adf51 into lightspeed-core:main Aug 11, 2026
17 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