Skip to content

Add Weighted Multi-Constraint Scoring Engine#53

Merged
dfeen87 merged 1 commit intomainfrom
jules-add-scoring-engine-11354591928326284294
Apr 10, 2026
Merged

Add Weighted Multi-Constraint Scoring Engine#53
dfeen87 merged 1 commit intomainfrom
jules-add-scoring-engine-11354591928326284294

Conversation

@dfeen87
Copy link
Copy Markdown
Owner

@dfeen87 dfeen87 commented Apr 10, 2026

Implemented the Weighted Multi-Constraint Scoring Engine to sit atop constraint bundles, aggregating domain-specific penalties, bonuses, and falsifications into a composite stability score without overriding original logic. Added WeightProfiles (DefaultResearchProfile, HighSafetyProfile) to contextualize candidate scrutiny. Includes relevant version bumps to v3.0.0 and extensive documentation additions.


PR created automatically by Jules for task 11354591928326284294 started by @dfeen87

This commit introduces a new scoring subsystem to the C++ parallel evaluation framework. The engine calculates a Composite Stability Score (0-100) using configurable `WeightProfile` abstractions, and wraps outputs in a detailed `ScoringReport`.

- Created `scoring/WeightedScoringEngine`, `scoring/WeightProfile`, and `scoring/ScoringPipeline`.
- Updated `MultiBundleEvaluator` to pass results into the scoring engine via new `.score()` methods.
- Added extensive documentation: `docs/scoring_engine.md` and `docs/weight_profiles.md`.
- Bumped version from 2.4.1 to 3.0.0 and updated `CHANGELOG.md`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings April 10, 2026 13:32
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dfeen87 dfeen87 merged commit 9006a4f into main Apr 10, 2026
4 checks passed
@dfeen87 dfeen87 deleted the jules-add-scoring-engine-11354591928326284294 branch April 10, 2026 13:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new weighted scoring subsystem that consumes EvaluationReport outputs and produces a composite “stability” score via configurable weight profiles, alongside a major version bump to 3.0.0.

Changes:

  • Introduced WeightProfile abstractions (with DefaultResearchProfile and HighSafetyProfile) plus a new WeightedScoringEngine, ScoringPipeline, and ScoringReport.
  • Integrated scoring into MultiBundleEvaluator via score(...) and score_with_profile(...).
  • Bumped project version to 3.0.0 and added/updated scoring documentation and changelog entries.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
setup.py Bumps package version to 3.0.0.
cura_frame/init.py Bumps Python package __version__ to 3.0.0.
README.md Updates citation version to 3.0.0.
CITATION.cff Updates version fields to 3.0.0.
docs/CHANGELOG.md Adds 3.0.0 changelog entry describing the scoring engine and profiles.
docs/scoring_engine.md Documents the scoring engine architecture and usage examples.
docs/weight_profiles.md Documents built-in weight profiles and extension guidance.
scoring/WeightProfile.hpp Defines the weight profile interface and two built-in profiles.
scoring/WeightProfile.cpp Placeholder translation unit for weight profiles.
scoring/ScoringReport.hpp Defines the structured scoring output.
scoring/WeightedScoringEngine.hpp Declares the core scoring engine API.
scoring/WeightedScoringEngine.cpp Implements weighted aggregation, falsification impact, and narrative generation.
scoring/ScoringPipeline.hpp Declares a pipeline wrapper around the scoring engine.
scoring/ScoringPipeline.cpp Implements pipeline execution.
constraint_core/MultiBundleEvaluator.hpp Adds scoring entry points that run the new pipeline on an EvaluationReport.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +13
WeightedScoringEngine::WeightedScoringEngine(std::shared_ptr<WeightProfile> profile)
: profile_(std::move(profile)) {}

ScoringReport WeightedScoringEngine::score(const EvaluationReport& eval_report) const {
ScoringReport report;
report.weight_profile_name = profile_->name();

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

profile_ is dereferenced without validating it is non-null (e.g., profile_->name()), so passing a null WeightProfile will cause an immediate crash. Consider enforcing non-null in the constructor (throw/assert) and/or making the constructor take a WeightProfile& / std::shared_ptr<WeightProfile> that is checked before use.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +70
std::string WeightedScoringEngine::generate_narrative(const ScoringReport& report, const EvaluationReport& eval_report) const {
std::ostringstream oss;

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

eval_report is not used in generate_narrative, which will trigger -Wunused-parameter warnings in many build configurations. Either remove the parameter from the declaration/definition, or mark it unused (e.g., omit the name in the signature or use [[maybe_unused]]).

Copilot uses AI. Check for mistakes.
Comment thread scoring/WeightProfile.hpp
Comment on lines +14 to +22
// Default fallback weight if a bundle or signal is not explicitly defined
virtual double default_weight() const { return 1.0; }

// Per-bundle weights
virtual double bundle_weight(const std::string& bundle_name) const = 0;

// Per-signal weights (can override bundle weights for specific signals)
virtual double signal_weight(const std::string& bundle_name, const std::string& signal_name) const = 0;

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The comment says default_weight() is a fallback when a bundle/signal isn't explicitly defined, but bundle_weight/signal_weight are pure virtual so the base class cannot actually provide that fallback behavior. Consider providing non-pure virtual defaults (e.g., bundle_weight returning default_weight() and signal_weight returning bundle_weight(bundle_name)), or update the docs/comments to clarify that derived profiles must implement their own fallback logic.

Copilot uses AI. Check for mistakes.
Comment thread scoring/WeightProfile.hpp
Comment on lines +43 to +45
double signal_weight(const std::string& bundle_name, const std::string& signal_name) const override {
return 1.0;
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

These overrides ignore their parameters, which can produce -Wunused-parameter warnings. Consider omitting unused parameter names in the signature or marking them [[maybe_unused]].

Copilot uses AI. Check for mistakes.
Comment thread scoring/WeightProfile.hpp
Comment on lines +59 to +63
double signal_weight(const std::string& bundle_name, const std::string& signal_name) const override {
if (signal_name.find("toxicity") != std::string::npos || signal_name.find("risk") != std::string::npos) {
return 1.5;
}
return 1.0;
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

bundle_name is unused here, which can produce -Wunused-parameter warnings. Consider omitting the parameter name in the signature or marking it [[maybe_unused]].

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +62
// Pass evaluation results to the scoring engine using a specific profile
ScoringReport score_with_profile(const EvaluationReport& report, std::shared_ptr<WeightProfile> profile) const {
ScoringPipeline pipeline(profile);
return pipeline.execute(report);
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

score_with_profile accepts a std::shared_ptr<WeightProfile> that may be null; downstream code dereferences the profile without checks, which can crash. Consider validating profile (throw/assert) and/or falling back to DefaultResearchProfile when profile == nullptr.

Copilot uses AI. Check for mistakes.
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