Skip to content

Accept reusable evaluation closures and validate run options - #139

Merged
Stephen Belanger (Qard) merged 1 commit into
refactor/eval-case-executionfrom
refactor/eval-callable-contracts
Oct 28, 2026
Merged

Stephen Belanger (Qard) merged 1 commit into
refactor/eval-case-executionfrom
refactor/eval-callable-contracts

Conversation

@Qard

Copy link
Copy Markdown
Contributor

Async functions and captured closures now implement Task directly, and (name, callback) tuples implement Scorer with borrowed or owned names. The task and scorer identity helpers supply lifetime/type context for boxed futures without adding wrapper state. Remove AsyncFnTask and SimpleAsyncFnTask; callbacks can borrow their input, hooks and scorer arguments across awaits and be reused concurrently without cloning user values. Update the async example, eval doctest and active recording integration to this shape.

Add EvalOpts::validate with typed EvalConfigError values for zero concurrency, blank scorer names and duplicate names. The current evaluator calls it before source access, login-dependent setup or recording. Builtin, custom and tuple scorers share the same validation. Existing synchronous adapters remain transitional until the normalized run context supplies a managed blocking executor.

Validation: 365 unit/integration tests and 10 doctests passed with all features, plus strict all-target Clippy, rustdoc, formatting and diff checks. Five new public tests cover borrowed functions, captured concurrent callbacks, both name forms and validation before side effects. Existing custom trait implementations remain valid.

Rust 1.86: 11 focused eval tests passed, both examples compiled, and both eval doctests passed in an isolated checkout with a Rust-compatible dependency resolution. The normal local resolution fails its MSRV check on both this source and parent #138 before compiling the SDK: bon/ICU/time require 1.88 and uuid requires 1.89. No dependency files changed; release preparation still needs to reconcile that resolution with the declared minimum. Older scorer fixtures now bind expected strings explicitly so their lifetimes compile on 1.86.

Stacked on #138. Normalized definitions/case sources, eager local/recorded scheduling, managed blocking callbacks and recorder/reporter separation follow. Planning documents are excluded.

@Qard
Stephen Belanger (Qard) merged commit 6247c49 into refactor/eval-case-execution Oct 28, 2026
2 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.

1 participant