Skip to content

impl(029): increment 1, the statistics core - #155

Merged
bartekus merged 1 commit into
mainfrom
impl/029-evaluation-repeatability
Oct 22, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/029-evaluation-repeatability

Conversation

@bartekus

@bartekus bartekus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 joins make verify at
completion.

  • rustev-eval/src/generator.rs: xoshiro256starstar-splitmix64/1 on
    wrapping u64 arithmetic (3.4.2), stream seeds through the contract's
    tagged_digest (3.4.3), the rejection-sampled uniform index (3.4.4) and
    run 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 keys
    refused, 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 bootstrap
    with exact integer ranks, one stream per cohort, B * C * N above 10^9
    refused 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 C
    implementations, CC0) printed generators.json; reference.py (Python 3
    standard library only, written from the spec text) writes
    expected.json from cases.json with every binary64 as its bit
    pattern and checks the C vectors; python3 -I reference.py --check
    regenerates 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.1
    rule and bound, identity, bands, and the section 5 rows on a one-run
    captured band and a zero deterministic_replay band.
  • tools/rustev-release/archive-policy.json: the three new source files
    join the reviewed archive list (spec 029 gains an additive extends
    edge on tools/rustev-release/, as spec 026 did).
  • Spec 029: frontmatter, increment plan, implementation record and the
    engineering choices made by the implementing agent.

Size: about 1,900 authored lines; expected.json, generators.json,
cases.json and the derived shards are generated.

Local verification (macOS arm64): make gate passes with spec-spine
0.31.0; python3 -I reference.py --check passes. Cargo build and tests
are left to CI here: the shared target was locked by other lanes' builds.

Round 1 CI: clippy collapsible_if in repeat_config.rs (fixed).

Review round 1 (1 finding, not a defect, evidence added): the finding says
reference.py's total_key sorts negative values above positive ones.
Python's ^ with the non-negative mask 0x7FFFFFFFFFFFFFFF keeps a
negative 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 than
argued, cases.json gains a set with negative values and zeros of both
signs (two quantiles and a mean), so the Rust test now compares that order
bit for bit, and total_key carries a comment saying why it holds. Also
in 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_refs in tests/bootstrap.rs (fixed).
Rebased onto main after #147 (no conflict).

Review round 3 (1 finding, fixed): the MAX_DENOMINATOR comment claimed
the case count was bounded, but nothing bounds it, so a saturating u64
sum could in principle saturate. Integer sums are now u128 (at most
u32::MAX per contribution, 64 runs and fewer than 2^64 drawn cases stay
below 2^102), with no saturating arithmetic left; the record states it.
Round 3 CI: code passed, including the bit-for-bit reference test.
Review round 4: no findings. Rebased onto main after #156 (no conflict).

@github-actions

Copy link
Copy Markdown

AI review (findings)

Review

Scope

Increment 1 of spec 029: the generator, repeat-config, bootstrap statistics, bands, and their tests. I checked the PRNG implementations against the C reference, the protocol of the stream-seed derivation against the Python reference, the percentile-rank arithmetic, integer-overflow bounds, and the shape and band logic.

Generator correctness

SplitMix64::next_u64 and Xoshiro256StarStar::next_u64 match the C reference constants and state-update order. from_splitmix seeds xoshiro256 from four consecutive SplitMix64 outputs, matching the C driver. The stream_seed digest extraction (digest[7..23], first 8 bytes big-endian) matches the Python reference. The rejection-sampler (index) computes 2^64 mod n as (u64::MAX % n + 1) % n and rejects via u >= 0u64.wrapping_sub(rem), both of which are correct u64 restatements of the Python's arbitrary-precision version.

Statistics and interval computation

percentile_ranks uses i128 ceiling division that matches the Python ranks function for all valid inputs (no overflow risk given level ∈ [0.5, 0.999] and B ≤ 100 000). The bootstrap draws the same cases indices for all metrics per resample (matching Python). The u > 0 guard before indexing v[lo-1] and v[hi-1] is correct; hi ≤ B is guaranteed because (1 + level) < 2. check_shape enforces num ≤ den and den ≤ u32::MAX, and the comment that saturating sums never reach u64::MAX holds under those bounds. Band logic: DeterministicReplay short-circuits on k_sd, IntervalWidth propagates the interval normally; an unknown sd or interval returns Unknown, never the floor.


Finding

reference.py — total_key implements the wrong sort order for non-positive samples

def total_key(x):
    b = struct.unpack(">q", struct.pack(">d", x))[0]
    return b ^ ((b >> 63) & 0x7FFFFFFFFFFFFFFF)

For a positive float +p, b ≥ 0, so b >> 63 = 0, and the key is the raw bit pattern — correct ascending order.

For a negative float −p, b < 0, so b >> 63 = -1. After XOR the top bit flips from 1 to 0 but the lower 63 bits are flipped, giving a key ≥ 0x8000000000000000 — larger than every positive float's key. Ascending sort therefore places positive numbers before negative numbers, opposite to IEEE 754 total order.

Likewise, −0.0 maps to key 0xFFFFFFFFFFFFFFFF and +0.0 to 0, so Python sorts +0.0 < −0.0. The correct IEEE 754 total order (and Rust f64::total_cmp) has −0.0 < +0.0.

The Rust code (repeat_stats.rs::ascending, run_stats, nearest_rank) uses f64::total_cmp, which is correct. The Python reference is not equivalent to it. Because all sample values in cases.json are positive floats (hex patterns 40xx…), expected.json is identical to what correct Python would produce and all Rust tests currently pass. However, any future test data containing negative or zero samples would silently produce a different expected.json than what the Rust implementation computes, causing a bit-for-bit mismatch.

The defect is in reference.py; the Rust implementation is correct per the spec's stated requirement ("IEEE 754 total order").


{"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.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 00:04 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/029-evaluation-repeatability branch from a5c0965 to 5eb7b0e Compare October 22, 2026 00:08
@github-actions

Copy link
Copy Markdown

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

stream_seed builds seed || 0x00 || label, passes it to tagged_digest(STREAM_TAG, …), and extracts the first 8 bytes as big-endian u64. The Python reference does the same via hashlib.sha256 and int.from_bytes(..., "big"). The byte sequences are identical; the test cross-checks every label in expected.json bit-for-bit. No defect.

Xoshiro256StarStar::index: rem = (u64::MAX % n + 1) % n correctly computes 2^64 mod n; rejection uses u >= 0u64.wrapping_sub(rem) (i.e., u >= 2^64 − rem); when rem == 0 (n divides 2^64) no draw is ever rejected. Correct.

repeat_config.rs

parse_seed rejects empty, leading-zero (except "0"), non-digit, and overflow inputs; s.parse::<u64>().ok() catches u64::MAX + 1. The test exercises every boundary listed in 3.3.1. check() enforces level ∈ [0.5, 0.999] with closed-bound </> comparisons; the test confirms 0.5 and 0.999 are admitted. No defect.

repeat_stats.rs

percentile_ranks: ceil_div((one ± level_units) * b, 2 * one) is exact integer ceiling division. With level = 0.95, B = 10 000 it gives (250, 9 750) as the spec states. Maximum intermediate value is ~2×10¹⁴, well within i128. The indexing into v[lo−1] and v[hi−1] is safe because when u == 0, v.len() == b.resamples and both ranks are in [1, B].

run_stats for an empty cases list returns unknown figures for all runs, then propagates them correctly to mean/sd/min/max/pooled; the tests confirm. The MAX_BOOTSTRAP_WORK guard is applied before any draw is made. The band function guards derived.is_finite() before partial_cmp, so None from NaN cannot occur at that point.

Spec lifecycle and archive-policy

implementation: pending → in-progress is correct per the contract table (approved + in-progress is schedulable). The new extends entry for spec 031's tools/rustev-release/ directory is consistent with the archive-policy.json modification. No rule requires the owner to separately ratify an incremental extends addition to an already-approved spec.

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.

@bartekus
bartekus force-pushed the impl/029-evaluation-repeatability branch 2 times, most recently from 6e68c3f to 7023e57 Compare October 22, 2026 00:22
@github-actions

Copy link
Copy Markdown

AI review (findings)

Review of PR 7023e57

Overview

This PR delivers Increment 1 of spec 029 (the statistics core): the xoshiro256starstar-splitmix64/1 generator, rustev.repeat-config/1, across-run statistics, case-clustered bootstrap intervals, and noise bands, together with a Python reference implementation and bit-exact test vectors.


Generator and stream seed (generator.rs)

The SplitMix64 and Xoshiro256StarStar implementations match the C reference character-for-character. The rejection-sampling index function correctly computes 2^64 mod n as (u64::MAX % n + 1) % n (which is exact for all n in [1, u64::MAX]) and the rejection threshold as 0u64.wrapping_sub(rem). The stream_seed function builds seed || 0x00 || label before calling tagged_digest(STREAM_TAG, …), matching the Python's sha256("rustev.bootstrap/1" || 0x00 || seed || 0x00 || label).


Repeat config (repeat_config.rs)

All rules in 3.3.1 are checked: method, PRNG name, level bounds, resample bounds, seed canonicality (parse_seed rejects leading zeros, empty strings, out-of-range values), k_sd multiplier bounds, non-negative floors, unique non-"all" slice names, non-empty unique stability metrics, and valid top_k. Test coverage confirms boundary cases in both directions.


Repeat stats (repeat_stats.rs) — Finding

The file declares:

/// The largest denominator one case contributes in one run. With cases and
/// runs bounded, integer sums cannot reach `u64::MAX`, so the saturating
/// additions below never saturate.
pub const MAX_DENOMINATOR: u64 = u32::MAX as u64;

check_shape bounds runs (≤ MAX_RUNS = 64) but imposes no bound on cases. The statistic function aggregates one cluster per case with saturating_add:

den = den.saturating_add(*d);

For the pooled statistic computed by run_stats, the accumulation is over all cases. Saturation at u64::MAX occurs when cases × (64 × u32::MAX) > u64::MAX, i.e., roughly 67 million cases for CountRatio/Mean, and around 4.3 billion cases for per-run sums (one contribution per case per run). After saturation den stays at u64::MAX while num is correct, so num as f64 / den as f64 silently produces a result near zero with no error signal. The intervals function is safe in isolation because its work-bound check limits cases * runs * resamples ≤ 10⁹, which bounds cases ≤ 10⁶ — well within the safe range. But run_stats is a public function with no such guard, so a caller supplying a large metric can obtain a silently wrong pooled value.


Bootstrap test vectors

The generators test against the C reference vectors, the statistics and intervals test against the independent Python reference bit-for-bit. The signed set exercises IEEE 754 total-order sorting with both signs of zero. The Python total_key function and Rust f64::total_cmp agree.


Spec and archive policy

The lifecycle transition from pending to in-progress is valid. The new extends entry linking to spec 031 for the archive directory is consistent with the three new source files added to archive-policy.json. No claim that an acceptance item is satisfied by this increment.


{"head": "7023e5777fb427d415b539c6e69e28dc57b3dabf", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/src/repeat_stats.rs", "line": 33, "summary": "The MAX_DENOMINATOR comment claims 'cases and runs bounded' but check_shape only bounds runs; the saturating_add for den in statistic() aggregates one cluster per case with no case-count limit, so run_stats with ~67M+ cases silently produces a wrong pooled value instead of returning an error."}]}

Subject: 0cc3b1e...7023e57, diff digest 6bdbb1f658ac7efce8e46a14bfa92d1adb39e414dac1633230da9993fe9cd305, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 00:30 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/029-evaluation-repeatability branch from 7023e57 to 3eb74ed Compare October 22, 2026 00:34
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

I'll review each changed file systematically, checking for implementation correctness, spec conformance, and security.

generator.rs — PRNG implementation

SplitMix64::next_u64 and Xoshiro256StarStar::next_u64 constants and update steps match the reference C implementations exactly. from_splitmix correctly seeds xoshiro256** from four consecutive SplitMix64 outputs.

stream_seed builds payload as seed.as_bytes() || 0x00 || label.as_bytes() and calls tagged_digest(STREAM_TAG, &bytes), producing sha256("rustev.bootstrap/1" || 0x00 || seed || 0x00 || label). This matches the Python reference exactly.

index uses correct rejection sampling: rem = (u64::MAX % n + 1) % n equals 2^64 mod n, and rejection condition u >= 2^64 - rem leaves 2^64 - rem accepted values, evenly divisible by n. When n | 2^64, rem = 0 and no rejection occurs.

repeat_config.rs — document validation

check() enforces all 3.3.1 rules. parse_seed correctly rejects leading zeros (except "0" itself), empty strings, and values outside u64 range.

repeat_stats.rs — statistical computations

percentile_ranks: with level_units ∈ [500_000_000, 999_000_000] and resamples ∈ [1_000, 100_000], intermediate i128 products stay well within range (max ~2e14). Results are in [1, resamples], so v[lo-1] and v[hi-1] index safely into the sorted resample vector when undefined == 0.

run_stats: mean uses left-to-right binary64 addition from zero; sample variance uses Bessel's correction with runs-1 ≥ 1 (since runs == 1 is short-circuited). Deterministic replay yields sd = Known(0.0) directly.

intervals: work guard B * C * N > 10^9 is checked before drawing. Empty cohort returns unknown intervals without drawing. All metrics in a cohort share the same stream, which is specified behavior.

band: the KSd+deterministic path returns the floor with DeterministicReplay basis immediately. The _ => arm of partial_cmp can only trigger if derived is NaN, but NaN is excluded by the preceding is_finite() guard — dead code but not a defect.

spec.md — lifecycle and structure

implementation: pending → in-progress is a valid transition per the contract table (approved + in-progress = schedulable). The new extends entry pointing to tools/rustev-release/ is consistent with the archive-policy update. The implementation record documents engineering choices not specified by the spec (draw ordering, seed spelling, empty-cohort treatment) appropriately under that heading.

archive-policy.json

Adds src/generator.rs, src/repeat_config.rs, src/repeat_stats.rs — exactly the three new source modules.

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.

@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 00:39
@bartekus
bartekus force-pushed the impl/029-evaluation-repeatability branch from 3eb74ed to 33b833f Compare October 22, 2026 00:40
@bartekus
bartekus disabled auto-merge October 22, 2026 00:40
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR carefully: it adds a PRNG (generator.rs), a repeat-configuration document type (repeat_config.rs), bootstrap statistics (repeat_stats.rs), comprehensive tests verified against independent C and Python reference implementations, and moves spec 029 to implementation: in-progress.

Generator correctness: The SplitMix64 and Xoshiro256StarStar implementations match the C reference constants and step sequences exactly. The stream_seed function builds seed_bytes || 0x00 || label_bytes and passes it to tagged_digest(STREAM_TAG, …), producing SHA-256("rustev.bootstrap/1\x00" || seed || 0x00 || label) — matching the Python reference. The rejection-sampling index function ((u64::MAX % n + 1) % n for the remainder; 0u64.wrapping_sub(rem) for the threshold) is algebraically identical to the Python (1 << 64) % n / (1 << 64) - rem.

Statistics: run_stats computes per-run statistics, mean/sd/min/max (Bessel-corrected), and pooled — all consistent with the Python reference. The nearest_rank ceiling division (q.units() * n + one - 1) / one matches -(-(q * n) // ONE). Both use IEEE 754 total order for sorting.

Bootstrap intervals: percentile_ranks matches the spec's own example (0.95, B=10 000 → 250, 9 750). The resample loop draws C indices per resample using the cohort's stream, applies to all metrics identically, and accumulates defined/undefined counts correctly. The MAX_BOOTSTRAP_WORK guard is checked before drawing. Index bounds: hi ≤ B = v.len() when u == 0, so no out-of-bounds access.

Integer overflow: u128 sums for count-ratio numerators/denominators. With B × C × N ≤ 10^9 and den_per_contribution ≤ u32::MAX, the maximum sum per statistic call is ≈ 4.3 × 10^15, well within u128 and below 2^53 (so den as f64 is exact).

RepeatConfig::check: All bounds from §3.3.1 enforced — method, PRNG name, level in [0.5, 0.999], resamples in [1 000, 100 000], seed canonical decimal, k_sd multiplier in (0, 10], non-negative floors, non-empty unique slices (none named "all"), non-empty unique stability metrics, top_k bounds. parse_seed correctly rejects leading zeros, overflow, and non-digits.

Band function: DeterministicReplay early-returns only for k_sd (not IntervalWidth), with the floor value and DeterministicReplay basis. Floor-vs-derived comparison: strictly-greater floor uses Floor basis; equal or lesser uses the derived basis — consistent with the implementation record's stated convention.

Spec consistency: implementation: pending → in-progress is correct. The new extends edge for tools/rustev-release/ (additive, via spec 031) is consistent with the archive-policy.json additions. The three new source files are inserted alphabetically within the existing crates/rustev-eval/src/ block.

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.

@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 00:46
@bartekus
bartekus merged commit fd19273 into main Oct 22, 2026
26 checks passed
@bartekus
bartekus deleted the impl/029-evaluation-repeatability branch October 22, 2026 01:07
bartekus added a commit that referenced this pull request Oct 22, 2026
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).
bartekus added a commit that referenced this pull request Oct 22, 2026
…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.
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