Repository navigation
impl(029): increment 1, the statistics core - #155
Conversation
AI review (findings)ReviewScopeIncrement 1 of spec 029: the generator, Generator correctness
Statistics and interval computation
Finding
def total_key(x):
b = struct.unpack(">q", struct.pack(">d", x))[0]
return b ^ ((b >> 63) & 0x7FFFFFFFFFFFFFFF)For a positive float For a negative float Likewise, The Rust code ( The defect is in {"head": "a5c09657e516de44fa1b2eebd4288e481167234e", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/tests/data/bootstrap/reference.py", "line": 100, "summary": "total_key sorts positive floats before negative floats (and +0.0 before -0.0), inverting the IEEE 754 total order for non-positive samples; the Rust code correctly uses f64::total_cmp, creating a latent bit-for-bit mismatch if future test data includes samples ≤ 0.0."}]}Subject: 4552b3e...a5c0965, diff digest 76f9ca24623434688320793bbe28c0633b7b7ef9738132e10f819861918d9136, 1 call(s). An AI comment is not an approval. |
a5c0965 to
5eb7b0e
Compare
AI review (no-findings)Reviewing the five changed areas: the PRNG implementation, repeat-config document, statistics engine, test suite, and spec/archive-policy updates. generator.rs
repeat_config.rs
repeat_stats.rs
Spec lifecycle and archive-policy
No concrete defect found. {"head": "5eb7b0e610ee38eb6f0b326e13c72d1d4c4f5e92", "verdict": "no-findings", "findings": []}Subject: 4552b3e...5eb7b0e, diff digest 565e59234a45184fd15e1c17a6693357bd316acd3d4bd7eb9bdd6bcf683c5ff2, 1 call(s). An AI comment is not an approval. |
6e68c3f to
7023e57
Compare
AI review (findings)Review of PR 7023e57OverviewThis PR delivers Increment 1 of spec 029 (the statistics core): the Generator and stream seed (
|
7023e57 to
3eb74ed
Compare
AI review (no-findings)I'll review each changed file systematically, checking for implementation correctness, spec conformance, and security.
Adds No concrete defects found. {"head": "3eb74ed06cd596226f698486b9228cd9a839ec8f", "verdict": "no-findings", "findings": []}Subject: 0cc3b1e...3eb74ed, diff digest 55fab3928a351793df9e276c25c2cb5fa4f601c10abcc79e3f14ffa6c1997c6f, 1 call(s). An AI comment is not an approval. |
3eb74ed to
33b833f
Compare
AI review (no-findings)Reviewing the PR carefully: it adds a PRNG ( Generator correctness: The Statistics: Bootstrap intervals: Integer overflow:
Band function: DeterministicReplay early-returns only for Spec consistency: No concrete defects found. {"head": "33b833f8c7176b287e11c4abd1a1340390cf5b07", "verdict": "no-findings", "findings": []}Subject: 3a238a1...33b833f, diff digest 55fab3928a351793df9e276c25c2cb5fa4f601c10abcc79e3f14ffa6c1997c6f, 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).
…se set (#162) ## Summary Spec 031 increment 5: the npm members and the absences in the release set, and the audit fix the first full release candidate found (spec 021). - **Release set (`tools/rustev-release/release-set.json`).** Spec 027 is complete (R-47), so its npm packages join the family: `npm` lists the seven per-platform packages by name, then `@statecrafting/rustev`, then `@statecrafting/rustev-wasm`, each with its directory. `absent` lists, with reasons, what 031 3.1 plans but this release does not ship: the prebuilt `rustev` CLI binaries (no release workflow yet; the CLI ships as the `rustev-cli` crate), the `rustev-serve` image and crate (spec 010 in progress), and `rustev-bedrock`, `rustev-backend-embed-linear`. `rustev-otel` (spec 028, #158) exists and stays under `excluded` with its reason. - **Check (`src/npm.rs`, run by `rustev-release manifests`).** Each npm member's `package.json`: name, family version, license, repository URL and directory, description, `files`, `os`/`cpu` for platform packages, no runtime dependency, the main package's `optionalDependencies` naming exactly the release's platform packages at exactly the family version, and the `"private": true` guard spec 027 keeps until publication (the release's packing step removes exactly that field). The set's shape refuses wrong npm order, wrong scope or directory, duplicates, and an absence with an unknown kind, no reason, or a member's name. `tests/npm.rs` passes on the repository and breaks each rule once. - **Audit fix (spec 021 3.6).** `make release-candidate` at `00a4b7c` (local) reproduced all eleven archives byte-identically, passed the archive policy, the unpacked tests on 1.98.1 and MSRV 1.88, and wrote every SBOM, then failed `cargo deny` on RUSTSEC-2026-0381 (`webpki-roots` 1.0.9) and RUSTSEC-2026-0382 (`rustls-webpki` 0.103.15), via `rustev-remote-http`. The lock now holds 0.103.16 and 1.0.10, and the workspace's `webpki-roots` floor is 1.0.10. Recorded in 021's implementation record; 021 3.7 stays open until the candidate passes in full at a commit with this fix. - **Archive bound (spec 021 3.5).** A second candidate run at this PR's first head (`3670e6b`) passed packaging and SBOMs, then failed the archive policy: `rustev-eval`'s unpacked total is 279,602 bytes against its reviewed bound of 262,144 after spec 029's statistics core (#155). The bound is raised, by review, to 393,216; the archive (73,245 bytes) and every other bound are unchanged. No workflow change; nothing is published. ## Review findings answered - Round 2 (`419b664`), `bundleDependencies` read as an object: fixed. The bundled list (either spelling) is judged as npm defines it (an array of names, or `true`); empty maps and lists declare nothing. Tests cover `[]`, a named list and `true` for both spellings, and `{}` for `dependencies`. - Round 3 (`9ad8a9b`), `rustev-otel` listed as absent and unimplemented: fixed. #158 merged the crate as an exclusion; the absence is removed and the record says why. - Round 4 (`9a461fe`), a refused directory still read: fixed. `expected_directory` gives each family package its one directory (a platform name is lowercase letters, digits and single hyphens), and `check_npm` opens only a member whose directory is exactly that; tests show a `..` directory or platform name is refused and never read. ## Checks - `cargo fmt --check`, `cargo clippy -p rustev-release --all-targets -D warnings`, `cargo test -p rustev-release` (all suites): passed locally on the first head; the round-2 fix is verified by CI (the shared target was in use by the candidate run). - `cargo run -p rustev-release -- manifests`: 11 crates and 9 npm packages pass. - `cargo deny ... check` with the release policy: advisories, bans, licenses, sources ok. - `make gate`: passed. `spec-spine couple`: OK. `check-authored-content.sh`: clean.
Spec 029 increment 1: the statistics core of evaluation repeatability
(3.3 to 3.5). Library only; no CLI, no repeat set, no live run, provider
call or spend.
implementation: in-progress; 029 joinsmake verifyatcompletion.
rustev-eval/src/generator.rs:xoshiro256starstar-splitmix64/1onwrapping
u64arithmetic (3.4.2), stream seeds through the contract'stagged_digest(3.4.3), the rejection-sampled uniform index (3.4.4) andrun seeds (3.4.6). No dependency added.
rustev-eval/src/repeat_config.rs:rustev.repeat-config/1(
REPLAY_V1, canonical identity, unknown fields and duplicate keysrefused, no binary64), every rule of 3.3.1.
rustev-eval/src/repeat_stats.rs: per-run values,mean,sd,min,max,pooled(3.3.2, 3.3.3); the case-clustered percentile bootstrapwith exact integer ranks, one stream per cohort,
B * C * Nabove 10^9refused before drawing (3.4); noise bands with their basis (3.5).
Unknown run values, undefined resamples and unknown band inputs stay
unknown, never a default.
tests/data/bootstrap/:generators.c(the authors' reference Cimplementations, CC0) printed
generators.json;reference.py(Python 3standard library only, written from the spec text) writes
expected.jsonfromcases.jsonwith every binary64 as its bitpattern and checks the C vectors;
python3 -I reference.py --checkregenerates and compares bytes.
tests/bootstrap.rs: generators, stream and run seeds, index draws,ranks, statistics and intervals bit for bit against the reference;
the size bound; shape refusals.
tests/repeat_config.rs: every 3.3.1rule and bound, identity, bands, and the section 5 rows on a one-run
capturedband and a zerodeterministic_replayband.tools/rustev-release/archive-policy.json: the three new source filesjoin the reviewed archive list (spec 029 gains an additive
extendsedge on
tools/rustev-release/, as spec 026 did).engineering choices made by the implementing agent.
Size: about 1,900 authored lines;
expected.json,generators.json,cases.jsonand the derived shards are generated.Local verification (macOS arm64):
make gatepasses with spec-spine0.31.0;
python3 -I reference.py --checkpasses. Cargo build and testsare left to CI here: the shared target was locked by other lanes' builds.
Round 1 CI: clippy
collapsible_ifinrepeat_config.rs(fixed).Review round 1 (1 finding, not a defect, evidence added): the finding says
reference.py'stotal_keysorts negative values above positive ones.Python's
^with the non-negative mask0x7FFFFFFFFFFFFFFFkeeps anegative integer negative, so the key is the IEEE 754 total order:
sorted([1.0, -1.0, 0.0, -0.0, -2.0, 3.5, float('-inf')], key=total_key)gives
[-inf, -2.0, -1.0, -0.0, 0.0, 1.0, 3.5]with keys-9218868437227405313, ..., -1, 0, .... To make this checked rather thanargued,
cases.jsongains a set with negative values and zeros of bothsigns (two quantiles and a mean), so the Rust test now compares that order
bit for bit, and
total_keycarries a comment saying why it holds. Alsoin this round: the bootstrap function refuses a seed, level or resample
count outside 3.3.1 (it is public, so it does not rely on the document's
check), and a contribution with a zero denominator is refused.
Review round 2: no findings. Round 2 CI: clippy
cloned_ref_to_slice_refsintests/bootstrap.rs(fixed).Rebased onto
mainafter #147 (no conflict).Review round 3 (1 finding, fixed): the
MAX_DENOMINATORcomment claimedthe case count was bounded, but nothing bounds it, so a saturating
u64sum could in principle saturate. Integer sums are now
u128(at mostu32::MAXper contribution, 64 runs and fewer than 2^64 drawn cases staybelow 2^102), with no saturating arithmetic left; the record states it.
Round 3 CI:
codepassed, including the bit-for-bit reference test.Review round 4: no findings. Rebased onto
mainafter #156 (no conflict).