Skip to content

feat(score_director)!: select the constraint provider and gate snapshot analysis - #171

Merged
blackopsrepl merged 2 commits into
mainfrom
feature/170-score-director
Nov 4, 2026
Merged

blackopsrepl merged 2 commits into
mainfrom
feature/170-score-director

Conversation

@blackopsrepl

@blackopsrepl blackopsrepl commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #170. Base main @ c114e2d2, two commits:

  • 13537458 feat(score_director)!: select the constraint provider
  • 5e33d374 feat(score_director)!: gate snapshot analysis on constraint_match_enabled

Gate on 5e33d374 (fmt, clippy -D warnings, doc-names file-length facade-reachability public-api deps, rustdoc -D warnings, examples, workspace all-feature tests, doctests): EXIT 0, 1506 passed, 0 failed, 64 result lines. Slice 1 alone: clippy, rustdoc, public-api bless, config/bridge/trybuild/constraint_providers/manager tests green.

`[score_director]` was parsed and never read. `constraint_provider` now
selects the constraint set a solve scores with: `#[planning_solution]`
accepts repeatable `constraint_provider = "path"` next to `constraints`,
each provider is its own monomorphized solve, and an undeclared name fails
before solving with `RuntimeBuildError::UnknownConstraintProvider`.
The selected provider's analysis is bound to the job through
`SolverRuntime::bind_snapshot_analysis`, so `analyze_snapshot` reports the
constraints the job scored with.

BREAKING CHANGE: `score_director.constraint_provider` must name a
`constraints` or `constraint_provider` path declared on the solution, or
the solve fails. `try_run_dynamic_solver_with_config_parts` takes
`&[DynamicConstraintProvider]` instead of one `constraints` function.
`RuntimeBuildError` gains the variant `UnknownConstraintProvider`.
…bled

`constraint_match_enabled` was parsed and never read. It now decides
whether a job's snapshots can be analyzed: `false` makes
`SolverManager::analyze_snapshot` fail with
`SolverManagerError::SnapshotAnalysisDisabled`. It defaults to `true`, so a
solve without a `[score_director]` section stays analyzable.

Closes #170.

BREAKING CHANGE: `score_director.constraint_match_enabled` now defaults to
`true`, and `false` disables `SolverManager::analyze_snapshot` for the job.
`SolverRuntime::bind_snapshot_analysis` takes
`Option<fn(&S) -> ScoreAnalysis<S::Score>>`, where `None` disables analysis.
`SolverManagerError` gains the variant `SnapshotAnalysisDisabled`.
@blackopsrepl
blackopsrepl force-pushed the feature/170-score-director branch from b3bffc8 to 5e33d37 Compare November 4, 2026 17:58
@blackopsrepl
blackopsrepl merged commit 5e33d37 into main Nov 4, 2026
17 of 18 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.

[score_director] is parsed but never read: implement constraint_provider and constraint_match_enabled

1 participant