Skip to content

Switch to computed scores across the autopilot#4391

Open
edjroz wants to merge 3 commits into
cowprotocol:mainfrom
edjroz:cleanup/score-migration
Open

Switch to computed scores across the autopilot#4391
edjroz wants to merge 3 commits into
cowprotocol:mainfrom
edjroz:cleanup/score-migration

Conversation

@edjroz
Copy link
Copy Markdown

@edjroz edjroz commented May 9, 2026

Description

Now that the combinatorial auction cutover (#3387) is complete, this PR fully transitions the autopilot from solver-reported scores to protocol-computed scores. The autopilot was still using Score::Solver when storing competition results, even though the actual scoring is done by the protocol. This aligns the stored score variant with reality and removes dead code from the driver.

Changes

  • Switch Score::SolverScore::Protocol in the autopilot run loop when recording solver settlements (crates/autopilot/src/run_loop.rs)
  • Remove unused score field from the driver's Solved struct (crates/driver/src/domain/competition/mod.rs)
  • Remove score from the driver's /solve response DTO (crates/driver/src/infra/api/routes/solve/dto/solve_response.rs)
  • Mark Score::Solver and Score::ProtocolWithSolverRisk as deprecated in the enum, keeping them for backward-compatible deserialization (crates/model/src/solver_competition.rs)
  • Add score_protocol_round_trip and score_solver_legacy_deserialize tests

How to test

cargo nextest run -p model score
cargo nextest run -p driver
cargo check -p autopilot

Related Issues

Should close #3415

- Use Score::Protocol instead of Score::Solver for autopilot-computed scores
- Remove dead `score` field from driver's /solve response DTO and Solved struct
- Mark Score::Solver and Score::ProtocolWithSolverRisk as deprecated
- Add tests for Score::Protocol serialization round-trip
@edjroz edjroz requested a review from a team as a code owner May 9, 2026 20:15
@edjroz edjroz changed the title Switch to computed scores across the autopilot (#3415) Switch to computed scores across the autopilot May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request deprecates the Solver and ProtocolWithSolverRisk score variants in favor of Protocol within the competition model. It removes the score field from the Solved domain object and the Solution DTO, while updating the autopilot to utilize protocol-calculated scores. Additionally, unit tests were expanded to include serialization round-trip and legacy deserialization checks. No critical issues found.

@edjroz
Copy link
Copy Markdown
Author

edjroz commented May 9, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 9, 2026
@edjroz
Copy link
Copy Markdown
Author

edjroz commented May 11, 2026

recheck

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.

chore: Switch to computed scores across the autopilot

1 participant