Repository navigation
impl(029): increment 3, repeat sets - #166
Conversation
AI review (findings)Reviewing the diff for bugs, security issues, and spec inconsistencies.
The Concrete defect — The spec text added by this PR (increment 3 description) states:
The new code in let observed = match (config.cost_units_comparable, unknown_charge) {
(false, _) => not_comparable(),
(true, true) => CaseMeasure::Unknown { … },
(true, false) => per_1000(run.cost.observed), // ← bug
};When The implementation-notes section of the updated spec also does not mention this case, confirming it was not an intentional choice recorded there. {"head": "4da3576f56c302c604f707b4fd24b1e4bff67676", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/src/report.rs", "line": 826, "summary": "cost_per_1000/observed is computed as a known value from the historical run record for candidate evaluations when cost_units_comparable=true and the run has no unknown charges and zero liability, contradicting the spec's 'candidate's cases carry none / unknown, never zero' requirement added by this PR."}]}Subject: 68f40c0...4da3576, diff digest f959182640f4a72663362afe6f72eed5487a4c950a7bd3067e0bad809cc73209, 1 call(s). An AI comment is not an approval. |
4da3576 to
ab281e9
Compare
AI review (no-findings)Reading through the diff carefully, focusing on correctness, security, and consistency.
fn observation(metric: &str, candidate: bool) -> Option<Observation> {
...
observed.then_some(if candidate {
Observation::Historical
} else {
Observation::Candidate
})
}The spec note in the diff says: "historical for candidate runs, candidate otherwise (3.11.2)." The tests confirm: a non-candidate run gets
Cost measures in
No concrete defect found in any of the changed paths. {"head": "ab281e9544cee719827c51fab5593e95515c82b9", "verdict": "no-findings", "findings": []}Subject: 68f40c0...ab281e9, diff digest b385feecdbf3552cfa8ba974e85cdc06d8eb7398f2ed6dbb6060210089716a73, 1 call(s). An AI comment is not an approval. |
ab281e9 to
bdd9d22
Compare
AI review (findings)Looking at the diff, I'll focus on concrete defects in logic, correctness, and spec consistency.
The function classifies a metric as latency/queue/cost by checking: let observed = metric.starts_with("latency_ms/")
|| metric.starts_with("queue_ms/")
|| metric.starts_with("cost_");
No other concrete defects were found: the {"head": "bdd9d22bbed246050d98a46669091c2b2350b5cf", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/src/repeat.rs", "line": null, "summary": "observation() matches cost_unknown_attempts via the starts_with(\"cost_\") prefix, incorrectly annotating a count metric with a Candidate/Historical observation that 3.11.2 reserves for cost-amount figures."}]}Subject: 1b0ce68...bdd9d22, diff digest b385feecdbf3552cfa8ba974e85cdc06d8eb7398f2ed6dbb6060210089716a73, 1 call(s). An AI comment is not an approval. |
2382319 to
64a89c9
Compare
AI review (no-findings)Reviewing the diff systematically across the new
The refactoring is mechanical:
Adding
The block is guarded by
The function returns
Spec No concrete defects found. {"head": "64a89c9b9c16f2977e24a0d346b604403c0d684f", "verdict": "no-findings", "findings": []}Subject: 262b37c...64a89c9, diff digest e85d8ff996ec4e3516701fbc594131799ce58ef45bc7c694fdf05d37f9cc8efa, 1 call(s). An AI comment is not an approval. |
64a89c9 to
dad31df
Compare
AI review (no-findings)Reviewing the PR, which adds
Archive policy — No concrete defects found. {"head": "dad31df087e6223a506de7ff66439fd87978fecc", "verdict": "no-findings", "findings": []}Subject: 6060167...dad31df, diff digest c057a541bc92b8314ca95ca46586dc33257c30b3ac3808e812873e1e810faa4e, 1 call(s). An AI comment is not an approval. |
dad31df to
b90a2f3
Compare
AI review (no-findings)I'll work through the diff systematically, focusing on the new
The refactor pulls the mean/sd/min/max computation out of
observed.then_some(if candidate {
Observation::Historical
} else {
Observation::Candidate
})
if inputs.source == Source::Replay
&& let Some(r) = runs.iter().position(|r| { ... })Let-chains were stabilized in Rust 1.88 (May 2025). The repo has a
The MixedRuns check verifies dataset, evaluator config, plan, and exact metric name/order equality. Since a candidate evaluation adds
The new
The cost-per-1000 measures are inserted only for non-candidate evaluations. The test
let stable_cases = members.iter().filter(|c| stable.contains(c)).count() as u64;
Spec update The increment-3 description in
No concrete defects found. {"head": "b90a2f379e1c0f94f786a6fdb6a6ab13731530b9", "verdict": "no-findings", "findings": []}Subject: 21a00fc...b90a2f3, diff digest 24024ce2febae051db677c2f276650def20b1064f9e8c14ca41e0d5a1759823b, 1 call(s). An AI comment is not an approval. |
b90a2f3 to
6365f83
Compare
AI review (no-findings)Reviewing the PR for bugs, security issues, and inconsistencies.
The function returns
The observed series has an
The new
The earlier check
Spec and archive policy The spec changes document engineering choices and the increment consistently with the code. The archive-policy insertion is in correct alphabetical order. No concrete defects, security issues, or governance violations found. {"head": "6365f83139437d8aea26d822526ed7c8653b7ff7", "verdict": "no-findings", "findings": []}Subject: 63334d6...6365f83, diff digest 24024ce2febae051db677c2f276650def20b1064f9e8c14ca41e0d5a1759823b, 1 call(s). An AI comment is not an approval. |
Spec 029 increment 3: repeat sets and
rustev.repeat-report/1(3.1,3.2.5, 3.5, 3.6). Library only; no CLI, ledger, baseline or gate yet; no
live run, provider call or spend.
implementationstaysin-progress.rustev-eval/src/repeat.rs(new):repeat(RepeatInputs)over Nreconciled runs. Refuses the
livesource (live-source-unavailable),N outside 1 to 64, unreconciled case measures (
reconcile), runs thatdiffer in dataset, split, evaluator configuration, plan or metric list
or do not list the split's cases in manifest order (
mixed-runs), areplayset whose runs are not identical (not-reproducible), anunreported stability metric or override, and a cohort over the
bootstrap bound (
bootstrap-too-large). The report names the source,configurations, dataset, split and fixed role (3.7.1), provenance,
adapter rules, plan, each run's document digests and run seed, the
stable cohort, and per cohort (
all, then each slice) every metric'sper-run values,
mean,sd,min,max,pooled, interval and bandwith its basis. Slices below their minimum are unknown throughout; a
metric without a per-case measure (cost totals,
brier) has across-runstatistics in
allonly. Latency, queue and cost metrics state theirobservation (
historicalfor candidate runs, 3.11.2). A held-out reportrecords
held_outas unknown until increment 4 adds the ledger.rustev-eval/src/report.rs,eval_cases.rs:cost_per_1000/observedand
/estimatedcase measures (3.2.5), unknown unless cost units aredeclared comparable, the observed series unknown for a case with
liability or an unknown charge; none for a candidate.
rustev-eval/src/repeat_stats.rs:across_runs, factored out ofrun_statsunchanged, for metrics stated only by the run reports.tests/reports.rs): replay set (zerodeterministic_replayband, pooled equal to the report, distinct run seeds, stable cohort,
totals and
brier, observations, unknowncost_per_1000, a reportedslice and one below its minimum, round trip and byte determinism);
captured set with a case losing its bundle (stable cohort, positive
k_sdband); one captured run (unknown band); differing replays, thelive source and N of 0 and 65 refused; mixed baseline and candidate
runs, unreconciled measures and an unreported stability metric refused;
a candidate set with historical observations and
interval_widthbands.
tools/rustev-release/archive-policy.json:src/repeat.rs.Still open from increment 2: owner decision D-029-1 (Brier per-case
measures), recorded in spec 029's implementation record.
Local verification (macOS arm64):
make gatepasses with spec-spine0.31.0;
cargo clippy -p rustev-eval --all-targets -- -D warnings,cargo test -p rustev-evalandcargo test -p rustev-fp-corpuspass.Review round 1 (1 finding, not a defect, evidence added): the finding says
a candidate's cases get a known
cost_per_1000/observedwhen costs arecomparable and known. The cost measures sit inside
case_measures_of'sif inputs.candidate.is_none()block (opened above the latency loop,outside the reviewed hunk), so a candidate's cases carry none. A comment
now says so in the hunk, and a new test,
cost_per_1000_is_measured_for_a_baseline_and_never_for_a_candidate,declares cost units comparable and checks that the baseline's cases carry
cost per 1000 while the candidate's carry none and its repeat report's
cost_per_1000/observedis historical and unknown.Review round 2: no findings. Rebased onto
mainafter #159 (no conflict).make codepasses locally on this head, except two failures caused byother worktrees sharing the build target (a test binary removed by a
concurrent
cargo clean, andrustev-jev'slodging_swapfinding itsoutput directory already created by a concurrent run); each passes when
rerun alone.
Review round 3 (1 finding, fixed by making the rule explicit): the finding
says
cost_unknown_attemptsshould carry no observation. It is one of thefour cost series a spec 004 candidate report replaces with "the candidate
was not executed; latency and cost are the baseline's", so it is an
observation of the runs and historical for a candidate, as 3.12.4 needs.
observationnow lists latency, queue, the four cost series andcost_per_1000/*by name instead of acost_prefix, with that reason inits comment; the candidate test checks the cost series are historical and
a quality metric has no observation.
Local on this head:
make gatepasses;cargo test --workspace --no-fail-fastpasses exceptrustev-release --test manifests, whichreports a
rustev-aicortexmember that exists only in another lane'sworktree sharing the build target, and passes when run alone; clippy,
fmt and boundaries pass.
Rebased onto
mainafter #157 (no conflict);rustev-evalandrustev-releasetests (includingmanifests, now thatrustev-aicortexis onmain) andrustev-evalclippy pass on the rebased head.Review round 4: no findings. Rebased onto
mainafter #162 (no conflict).Review round 5: no findings. Rebased onto
mainafter #160 (no conflict);make codeandmake gatepass locally on this head.Review round 6: no findings. Its
coderun failed inrustev-remote-http --test runtime_batch(
a_deadline_or_a_cancellation_after_send_ends_every_member_as_independent_calls_do),a timing test in a crate this PR does not touch. Rebased onto
mainafter#167, which changes no Rust source, so the previous head's local
make codestill covers the Rust tree;
make gatepasses.