Skip to content

impl(041): repeat evaluation applies the adapter's measures - #425

Merged
bartekus merged 1 commit into
mainfrom
impl/039-repeat-measured
Oct 31, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/039-repeat-measured

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Fix: rustev eval --repeat-config refused every rustev.evaluator-config/3 with invalid_input (Adapter), because crates/rustev-cli/src/repeat.rs evaluated each run with evaluate_with_cases, which carries no adapter measures. Spec 041 3.11 and spec 029 3.4 require the 041 ranking and rubric metrics to take part in repeat statistics.

  • Each run is now evaluated with evaluate_measured_with_cases and the task adapter (no scores document: --scores is already refused with --repeat-config). Under versions 1 and 2 the measured path is byte-identical to the previous one, so existing repeat goldens are unchanged.
  • New CLI test version_3_repeat_evaluates_the_measures_in_every_run (crates/rustev-cli/tests/eval.rs): a version 3 lodging configuration repeated twice on final_test; every run report and case-measures document carries ranking/offers/*, and the repeat report includes them. It fails on main with the Adapter refusal.
  • Spec 041's implementation record gains a dated paragraph.

Found by spec 039's Bedrock swap test (#424), whose version 2 workaround is dropped in a follow-up once both land.

Verification (local): cargo test -p rustev-cli --locked (all suites), clippy -D warnings on rustev-cli, cargo fmt --all --check, make gate.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at the diff across the three changed files:

crates/rustev-cli/src/repeat.rs: The fix is straightforward -- switching evaluate_with_cases to evaluate_measured_with_cases and supplying Measured { adapter: &adapter, scores: &[] }. The empty scores slice is correct since --scores is refused with --repeat-config, as the comment explains. No issues here.

specs/041-ranking-and-rubric-metrics/spec.md: The fix note is purely additive and documents the defect and its resolution accurately. No issues.

crates/rustev-cli/tests/eval.rs: The new test is inserted at the wrong position in the file. The hunk context shows the new code is injected inside an existing doc-comment block:

 /// Spec 041, 3.10.2 and 3.10.3: `eval views` writes the views `eval`
 /// computes; `eval --scores` reads a scorer's document and adds
+/// Spec 041 3.11 and spec 029 3.4: ...   ← new test's own doc comment starts here
+#[test]
+fn version_3_repeat_evaluates_the_measures_in_every_run() { ... }
+
 /// `views.json` to `out`; ...             ← remainder of original comment
 #[test]
 fn version_3_eval_writes_views_and_reads_scores() {

In Rust, consecutive /// lines attach to the very next item. The result is:

  • version_3_repeat_evaluates_the_measures_in_every_run receives the first two lines of the adjacent function's doc comment (describing 3.10.2/3.10.3 views/scores behaviour) prepended to its own doc comment.
  • version_3_eval_writes_views_and_reads_scores loses those first two lines and has a truncated doc comment beginning mid-sentence with `views.json` to `out`; ….

The new test should have been inserted before the doc-comment block for version_3_eval_writes_views_and_reads_scores, not inside it.

{"head": "3b60e2a7ac819e12a112885ac085e128706a9d6e", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/eval.rs", "line": 1392, "summary": "New test inserted in the middle of the existing doc-comment for `version_3_eval_writes_views_and_reads_scores`, so the new test inherits two lines of the wrong function's doc comment and the existing function's doc comment is left truncated."}]}

Subject: 8517df9...3b60e2a, diff digest 5eb7def05b57fbe494a6658e08da1bb2fbfab8804645bc85e4170e674b9c5478, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 30, 2026 23:15 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/039-repeat-measured branch from 3b60e2a to fd54e3b Compare October 30, 2026 23:19
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the three changed files for bugs, security issues, and governance inconsistencies.

crates/rustev-cli/src/repeat.rs

The switch from evaluate_with_cases to evaluate_measured_with_cases is the core fix. Measured { adapter: &adapter, scores: &[] } is passed in every iteration. The comment asserts that --scores is refused when --repeat-config is present, which justifies the empty scores slice. I cannot see that guard from the diff, but it is a pre-existing constraint (not newly introduced here), and the original function never accepted scores at this call site either. The claim that "versions 1 and 2 evaluate byte for byte as before" would be caught by existing tests if false.

crates/rustev-cli/tests/eval.rs

The new test version_3_repeat_evaluates_the_measures_in_every_run exercises the fixed path end-to-end: two repeat runs, per-run report contains ranking/offers/precision@2, per-run cases contain the metric name, and the aggregated repeat.json contains ranking/offers/ndcg@3. Coverage is appropriate for the claimed behaviour (spec 041 §3.11, spec 029 §3.4). String .contains() checks on JSON are consistent with the pre-existing test style in this file and are acceptable for metric names with no realistic collision risk.

specs/041-ranking-and-rubric-metrics/spec.md

The fix note is appended to the spec body just before ## Decisions at approval. The contract prohibits editing an amended spec.md to record an amends edge declared in another spec's frontmatter, but this is not that case: the spec is correcting its own implementation record for a bug. No amends edge is being suppressed. The fix note is factual and consistent with the code change.

No governance rule violation, no security defect, no concrete logic error is evident from the supplied evidence.

{"head": "fd54e3bdb098b5f869c2f8c26993f7c40e056b81", "verdict": "no-findings", "findings": []}

Subject: 8517df9...fd54e3b, diff digest fbe940de93e5852ef0cf9cec4037e2f8d9e9e9715fdc557e627341a0bb64c91d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 2cfbfee Oct 31, 2026
30 checks passed
@bartekus
bartekus deleted the impl/039-repeat-measured branch October 31, 2026 00:06
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