Repository navigation
impl(029): increment 2, per-case measures - #161
Conversation
AI review (findings)Reviewing the PR: per-case measures ( Finding:
pub fn metric_cases(metric: &str, form: Form, runs: &[&EvalCases]) -> MetricCases {
let n = runs.first().map_or(0, |r| r.cases.len());
let cases = (0..n)
.map(|c| {
runs.iter()
.map(|r| {
r.cases[c] // ← panics if r.cases.len() < n
Within this PR the function is only called from No other concrete defects were found. The {"head": "9add07519179e18a759f8a2c79f03c260d0d7ed7", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/src/eval_cases.rs", "line": 114, "summary": "metric_cases indexes r.cases[c] up to the first run's length without bounds-checking subsequent runs, causing a panic if any later run has fewer cases and silent data loss if it has more."}]}Subject: fd19273...9add075, diff digest f7257883da05ce17e3a4a42b0899441aa683e894c147e3136a4c84019e1b48bf, 1 call(s). An AI comment is not an approval. |
9add075 to
2d8cc2b
Compare
AI review (no-findings)Looking at this PR, which introduces per-case measures (
The
The refactor pulls exactly the fold and bin-find from
Per-quantile latency: the same
Spec update The renumbering (increments 2→6 instead of 2→5) correctly reflects the split of the original increment 2. The D-029-1 open decision is properly framed. Archive policy
No concrete defects found. {"head": "2d8cc2ba5a6a6af6ba804a3b53a97daab6557efc", "verdict": "no-findings", "findings": []}Subject: fd19273...2d8cc2b, diff digest 0b55991a86787b91fc2332a45d92fe143c3da8cff843873c25908eeadc076584, 1 call(s). An AI comment is not an approval. |
2d8cc2b to
68fbb9e
Compare
AI review (no-findings)I reviewed the full diff carefully: the new eval_cases.rs – reconcile logic metrics.rs – log_loss_term extraction repeat_stats.rs – Unknown propagation report.rs – evaluate_inner / evaluate_with_cases Spec update archive-policy.json No concrete defect found. {"head": "68fbb9e48f54962fe82831cb997ed218fa2eec87", "verdict": "no-findings", "findings": []}Subject: fd19273...68fbb9e, diff digest 7d81e532325d58b5abddf887f5716044f5dafac646d5246c666dc951e3a0475b, 1 call(s). An AI comment is not an approval. |
68fbb9e to
71b903d
Compare
AI review (findings)Reviewing the PR, which implements
Concrete defect found: In impl ParseDigest for str {
fn parse_digest(&self) -> rustev_contract::ids::ContentDigest {
rustev_contract::ids::ContentDigest::parse(self).unwrap()
}
}is invoked as {"head": "71b903d13f47d743ba5eae30b6b4e3bb3e5e4b7b", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/tests/reports.rs", "line": null, "summary": "ParseDigest impl calls ContentDigest::parse(self).unwrap() on a DatasetId string, which likely panics before reaching reconcile, converting a deliberate reconcile-failure test into an unhandled panic."}]}Subject: 70a6424...71b903d, diff digest 7d81e532325d58b5abddf887f5716044f5dafac646d5246c666dc951e3a0475b, 1 call(s). An AI comment is not an approval. |
71b903d to
4633a1d
Compare
AI review (no-findings)Reviewing the diff carefully for bugs, security issues, and inconsistencies.
The
The bit-equality comparison
The
The increment-2 description accurately mirrors the implementation: document layout, metrics covered, the
No concrete defects found. {"head": "4633a1d9a17aaf1f94eb76b6a67bd8b5dbc7e633", "verdict": "no-findings", "findings": []}Subject: 70a6424...4633a1d, diff digest cf9d2454dbddeecb97e886bb1cb3d9f5c4e9b613c3f41d88410fae1bf92413ac, 1 call(s). An AI comment is not an approval. |
4633a1d to
71a5868
Compare
AI review (no-findings)Reviewing the PR, which implements spec 029 increment 2: per-case measures (
No concrete defects found. {"head": "71a5868165154a267477bd9bb0efd30087ebc971", "verdict": "no-findings", "findings": []}Subject: cf6665c...71a5868, diff digest 1d89f5a0f47f4ff0c3b3a4b32c8dc8dcded4475b33f684c215bf4e5d96ca0f25, 1 call(s). An AI comment is not an approval. |
71a5868 to
88eca55
Compare
AI review (no-findings)Looking at the PR, I'll examine the key changes: the new
Spec update The acceptance schedule renumbering (items 2→2+3, former 3→4, etc.) is internally consistent.
No concrete bugs or security issues found. {"head": "88eca55730e304d55ecd89b47c9fddcbbd493c1c", "verdict": "no-findings", "findings": []}Subject: 70b99ea...88eca55, diff digest 1d89f5a0f47f4ff0c3b3a4b32c8dc8dcded4475b33f684c215bf4e5d96ca0f25, 1 call(s). An AI comment is not an approval. |
Spec 010, increment 2: the `rustev-aicortex` adapter, a non-released integration. Follows #156 (spec 021 3.4, R-49, merged), which makes the `rustev-aicortex` binding record's item 1 pass; rebased onto `main` after it. Nothing here authorizes a release, publication, live service call, spend or real-user data. ## Changes - `integrations/rustev-aicortex/`: `AicortexContext`, a bounded read of one claim-history page per bound subject under an explicit transaction bound, mapped through a declared projection of 1 to 64 field bindings into attributed snapshot entries (values, conflicts, refusals and missing fields named; no partial history read as complete), and `stage_observation`, an observation proposal with its Rustev lineage staged into the host's `TxnBuilder` and never committed. Aicortex is pinned at the record's revision `6415b765e5267188b4ecf302a93869352e28cccc`, with Rahi `=0.6.0`, which that revision pins. Tests: unit tests of the projection, kind mapping, identities and refusals, and integration tests against a single-voter Rahi 0.6.0 store with Aicortex's schema on loopback. The code is the adapter kept on `wip/010-rustev-aicortex-adapter` (`c776546`), unchanged. - `specs/010-integrations/spec.md`: the `rustev-aicortex` record's item 1 passes under R-49 (its Git dependency is outside the release closure; every release member still resolves from crates.io only), so the record passes every row; `planned: true` is removed from its `establishes` entry; the Verification block runs its tests, clippy and build and the authorization-type grep; the implementation record describes increment 2. - `tools/rustev-release/release-set.json`: `rustev-aicortex` is excluded from the release family. `docs/backlog.md` RUSTEV-015 state. - `tools/rustev-release/tests/manifests.rs`: #156's `a_git_source_only_an_excluded_package_reaches_is_not_judged` asserted exactly one violation when the resolve graph is absent, which held only while no workspace package had a Git source. With `rustev-aicortex` its real Aicortex packages are judged too (`code` failed on `b988788`), so that case now asserts the added package is among the violations and every violation is a source violation. - `Cargo.lock`: regenerated by Cargo for the Aicortex revision and Rahi 0.6.0's graph (Rahi 0.7.1's entries stay; Cargo now names the two Rahi versions explicitly in dependency lists). ## Limitation The adapter pins Rahi 0.6.0 and `rustev-rahi` pins 0.7.1, so one host cell cannot link both until Aicortex adopts Rahi 0.7.1 (record item 1). `rustev-serve` stays unimplemented (its record refuses). ## Review history Round 1 on `374a86b` (stacked on #156): no findings. Rebased onto `main` at `3a238a1` after #156 merged (no conflict, derived shards unchanged). Round 2 on `b988788`: no findings, but the `code` job failed on the manifest test above; fixed in this head. Round 3 on `413c222` (1 finding, rejected with evidence): it read `serde_core` in `uuid`'s dependency list as an unrecognized crate. `serde_core` is serde's own core crate, which `serde` 1.0.220 and later depend on; `main` at `3a238a1` already locks it (`Cargo.lock`: `name = "serde_core"`, `version = "1.0.229"`, crates.io, checksum `67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48`), and `serde` 1.0.229's entry lists it. This PR adds no `serde_core` package entry; only the `uuid` edge is new, because Aicortex enables `uuid`'s `serde` feature. Round 3 rerun on `413c222` (the `code` job had a timing flake in `rustev-remote-http`'s `runtime_batch`, untouched here; run re-run): no findings. Rebased onto `main` at `fd19273` (#155, no conflict). Round 4 on `2a80b7b`: no findings. Rebased onto `main` at `70a6424` (#154, no conflict). Round 5 on `199b201`: no findings; held for the coordinator's merge hold. Rebased onto `main` at `cf6665c` (#151, no conflict; `Cargo.lock` still resolves with `--locked`). Round 6 on `0024f6c`: no findings; held for the coordinator's merge hold. Rebased onto `main` at `70b99ea` (#158): `release-set.json` kept both the new `rustev-otel` exclusion and this one; the manifest tests pass locally (18 of 18). Round 7 on `0550224`: no findings. Rebased onto `main` at `68f40c0` (#161, no conflict). Round 8 on `2ccb9f9` (1 finding, the same `serde_core` question as round 3): the `rustev-aicortex` record's item 1 now states the new `uuid -> serde_core` edge and where `serde_core` comes from, so the evidence is inside the diff. Round 9 on `242c75f`: no findings. Rebased onto `main` at `1b0ce68` (#159, no conflict).
Spec 029 increment 2: per-case measures (3.2). Library only; no CLI, no
repeat set yet, no live run, provider call or spend.
implementationstays
in-progress.rustev-eval/src/eval_cases.rs(new):rustev.eval-cases/1(
REPLAY_V1, record canonical): the run report's record digest, thedeclared top-k parameter, and per case in manifest order its id, run
record digest, detail outcome key, top-k list and measures (
count,mean,sample, orunknownwith its reason).form_ofmaps spec004's reported metric names to their per-case form;
reconcilerefusesmeasures that are not bound to the report, do not list the detail's
cases and outcomes in order, name an unreported or total metric, fail to
reproduce a case-decomposable metric bit for bit, or do not sum to the
detail's counts (3.2.6).
rustev-eval/src/report.rs:evaluate_with_cases(inputs, top_k)runsthe unchanged evaluation and records each case's term from the report's
own functions, then reconciles.
evaluateis unchanged; its report anddetail are byte-identical with or without the measures.
rustev-eval/src/metrics.rs:reliability_bin(now used byreliability),log_loss_termandbrier_term, with no change to anyreported value.
rustev-eval/src/repeat_stats.rs:Contribution::Unknown, which makesevery statistic over it unknown and every resample drawing it undefined.
tests/reports.rs(byte identity, reconciliation, round trip,candidate without latency, eleven refusal cases, lodging top-k),
tests/metrics.rs,tests/bootstrap.rs.tools/rustev-release/archive-policy.json:src/eval_cases.rsjoins thereviewed archive list (spec 029's existing
extendsedge).increment 2 record and engineering choices.
Owner decision needed (D-029-1, recorded in spec 029's implementation
record): Brier per-case measures. 3.2.3 lists
brieras a mean and3.2.6 requires bit-for-bit reconciliation, but spec 004 adds every class
term to one running sum, so per-case sums differ in the last bit on
ordinary inputs (
tests/metrics.rshas a three-case counterexample), andspec 029 may not change how spec 004 computes a metric. Until decided,
brierhas no per-case measure and its interval is unknown, neverapproximated. Options: keep it so; reconcile Brier within a tolerance; or
amend spec 004 to sum per case first (changes existing Brier bits).
Local verification (macOS arm64):
make gatepasses with spec-spine0.31.0;
cargo clippy -p rustev-eval --all-targets -- -D warningsandcargo test -p rustev-evalpass.Review round 1 (1 finding, fixed):
metric_casestook its case countfrom the first run and indexed the others blindly. It now returns a
result and refuses (
mixed-runs) runs that do not list the same case idsin the same order, whichever comes first;
tests/reports.rscovers ashorter run in either position and a reordered one.
Review round 2: no findings. Round 2 CI (
code): spec 027'severy_call_site_is_in_the_corpusrefused a secondmath::lncall sitein
metrics.rs(log_loss_termbesidemean_log_loss).mean_log_lossnow adds
log_loss_term's-ln(p), so there is one call site again;sum + -ln(p)issum - ln(p)bit for bit (IEEE 754 defines subtractionas addition of the negation), and every existing eval test and the corpus
test pass locally.
Review round 3: no findings. Rebased onto
mainafter #154 (no conflict).Review round 4 (1 finding, clarified): the "another report" refusal case
built its digest by parsing the dataset id as a content digest. That
succeeds (both are
sha256:digests, and the test passed), but it read asa likely panic; it now uses an explicit all-zero digest, and the helper
trait is gone.
Review round 5: no findings. Rebased onto
mainafter #151 (no conflict).Review round 6: no findings. Rebased onto
mainafter #158 (no conflict).