Skip to content

feat(065): run integrity failures void the selection comparison; 065 complete - #554

Merged
bartekus merged 1 commit into
mainfrom
impl/065-complete
Nov 7, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/065-complete

Conversation

@bartekus

@bartekus bartekus commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Completes spec 065 (selection gate: run integrity failures void the comparison instead of rejecting; amends 029 and 061) for release 0.6.0.

What changes

  • rustev-eval: new module integrity (065 3.5). Integrity gate member with the field rules of 3.1 (at least one bound, 0 to 1 000 000, unknown fields refused); public synchronous counts evaluated_counts (3.2.1, 3.2.2) and host_counts (3.2.3, 3.2.4), each naming the verified documents read.
  • selection (029) and host_select (061): integrity is checked after the binding preconditions and before coverage, baseline runs first and computed once (3.3). A breach or an unestablished count makes every clause unknown (precondition: integrity); the verdict names the first breached entry (3.4.1, 3.4.2). Never rejected, never qualifies, never ranked (I-1, I-2).
  • rustev-cli gate select: a void candidate gets notice: "void: repeat the run" on stdout; exit 12 (3.3.5, 3.4.3).
  • Conformance: one CLI case cli/integrity-void.stdout.
  • Mutation: five spec 065 acceptance seeds (seeds.sh "spec 065"), all detected.
  • Spec: Implementation record, implementation: complete, declared ## Verification; 065 added to VERIFIED_SPECS and the cli-repeat acceptance group; spec 001 extends edges for Makefile and scripts/acceptance/ (Territory paragraph).

Gates without integrity keep their bytes, identities, selection output, stdout and exit codes (R-1); no existing golden, PlanId, schema or binding type changes.

Reading recorded in the Implementation record: a declared scorer that feeds no rubric metric has no per-scorer unscored count in the verified report, so the run's invalid count is unestablished (3.2.5).

Evidence

  • cargo test -p rustev-eval --locked (349), -p rustev-cli (132), -p rustev-conformance (13), workspace clippy -D warnings, fmt: pass.
  • seeds.sh "spec 065": 5/5 detected.
  • make gate: pass.

Review the source; tools/rustev-conformance/cases is generated and review-excluded.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for spec 065's implementation: integrity preconditions on SelectionGate, counts for both Rustev-evaluated and host runs, notice: "void: repeat the run" on stdout for void candidates, and the lifecycle transition to complete.

Logic and correctness

  • Integrity::check() correctly enforces at least one bound and [0, 1_000_000] range; u64 typing rejects negative values at the deserializer layer.
  • entry() correctly uses count <= limit (inclusive equality is a pass), matching the golden "upstream-failures: count=1, limit=1" → pass.
  • Baseline integrity is computed once and cloned per candidate, so a baseline breach voids every candidate — the mutation seed "a baseline breach applied to one candidate only" guards this.
  • In repeat.rs, the notice injection fires only when done.code == 12 and the candidate's verdict clause ends with .integrity. Candidates with other unknown verdicts or qualifies/rejected verdicts are not affected; the changed guard prevents re-serialising when nothing matched.
  • budget_exhausted is intentionally excluded from the upstream-failures count (equality_holds_budget_is_excluded_and_no_scorer_is_never_zero confirms this, the mutation seed guards it).
  • SelectionGate's skip_serializing_if = "Option::is_none" preserves the identity of existing gates without integrity; the test gate_field_rules_and_legacy_identity verifies this.

Golden file consistency

  • integrity-void.stdout has the notice field; integrity-void.json does not — matching the spec's requirement that the notice appears only on stdout (3.4.3). The host-invalid, host-baseline, host-mixed goldens are consistent with the same rule.

Spec / lifecycle

  • The transition from pending to complete on an approved spec is correct (contract: approved + complete = settled). The extends entries for Makefile and scripts/acceptance/ match what the diff actually changes. 065 joins VERIFIED_SPECS and the cli-repeat acceptance group.

No concrete defects found.

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

Subject: 186dbc9...5479cd9, diff digest 67ca5d5c8815a204a357733164f6c5930387b83db4e5063d91cc020d2441b53d, 1 call(s). An AI comment is not an approval.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for bugs, security problems, and inconsistencies against the governance context.

Key areas examined

crates/rustev-eval/src/integrity.rs (new file)

  • Integrity.check() correctly requires at least one bound and enforces the [0, 1,000,000] integer range; u64 prevents negative values at the type level.
  • The present deserializer ensures null values for max_invalid/max_upstream_failures fail at parse time (confirmed by test gate_field_rules_and_legacy_identity).
  • evaluated_counts uses checked_add to guard against overflow in the unscored count fold.
  • budget_exhausted is intentionally excluded from upstream-failure counting; the seed "budget_exhausted counted as upstream" and test equality_holds_budget_is_excluded_and_no_scorer_is_never_zero validate this.
  • The breached predicate (clause.ends_with(".integrity")) is unambiguous — no other clause names in the system end with the literal string .integrity.

crates/rustev-cli/src/repeat.rs

  • The notice is added only to stdout (via done.out.set), not to the saved JSON artifact — intentional per spec 065 §3.4.3 and confirmed by the golden pair (integrity-void.stdout has the notice, integrity-void.json does not).
  • The done.code == 12 guard correctly scopes the post-processing to unknown-status outputs; the verdict.unknown.clause.ends_with(".integrity") check correctly selects only integrity-voided candidates, leaving reject/qualify verdicts unmodified (confirmed by integrity/reject.stdout having no notice, integrity/holds.stdout having no notice, integrity/host-mixed.stdout having the notice only on bad).
  • expect("command output is JSON") is an internal panic on a non-user-controlled byte stream — acceptable.

crates/rustev-eval/src/selection.rs and host_select.rs

  • Baseline integrity is computed once and cloned per candidate — baseline breach voids all candidates, candidate breach voids only that candidate. This matches the spec and the test baseline_breach_voids_every_candidate_and_good_candidate_can_still_qualify.
  • The filter(|_| base_ok.is_ok()) guard on baseline integrity is safe: if baseline verification fails, precondition.err() is Some(...) and the integrity block is skipped by the reason.is_none() guard.
  • Backward compatibility: skip_serializing_if = "Option::is_none" on SelectionGate.integrity ensures gates without the field hash identically to before (confirmed by gate_field_rules_and_legacy_identity).

Spec lifecycle

Changing implementation: pending → implementation: complete on an approved spec is the standard lifecycle transition after implementation; it requires no additional owner ratification.

tools/rustev-release/archive-policy.json

Correctly adds src/integrity.rs to the reviewed archive list as required by spec 021 §3.5; the extends edge on tools/rustev-release/ (031, additive) is present in the spec.

No concrete defects found.

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

Subject: 186dbc9...d6280d6, diff digest a73bf4874c9d24b099aba1f18193c1e0d17b006c3877d30b49f501550f0e98c1, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
…complete

The selection gate gains the optional integrity member (3.1); per-run
invalid and upstream-failure counts are read from verified documents
(3.2) and checked after the binding preconditions and before coverage, so
a breach or an unestablished count makes the candidate unknown and never
rejected (3.3, 3.4). gate select prints void: repeat the run. Gates
without the member keep their bytes, identities and results (R-1). Adds
the goldens, one conformance case, five acceptance seeds, the declared
verification, 065 in VERIFIED_SPECS and the cli-repeat group, and
src/integrity.rs in rustev-eval's reviewed archive list (021 3.5).
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for spec 065's implementation — a new integrity precondition on gate select that voids a candidate instead of rejecting it when upstream-failure or invalid-score counts breach configured bounds.

crates/rustev-eval/src/integrity.rs

  • Integrity::check() correctly enforces "at least one bound" and the [0, 1,000,000] inclusive range (n > 1_000_000 rejects 1,000,001, allows 1,000,000). The error message matches.
  • The present deserializer is used on max_invalid and max_upstream_failures to reject null values while keeping #[serde(default)] honoring field absence. Used again on SelectionGate.integrity to reject "integrity": null. All the cases in gate_field_rules_and_legacy_identity confirm this.
  • evaluated_counts explicitly excludes abstention:budget_exhausted from upstream_failures. This is intentional: the negative seed in seeds.py checks that adding budget_exhausted to the list is caught. The test equality_holds_budget_is_excluded_and_no_scorer_is_never_zero confirms budget_exhausted with limit 0 passes (exit 0).
  • host_counts counts all HostOutcome::Failed(_) as upstream failures — no per-reason exclusion, which differs from the Rustev-evaluated path. This is consistent with the host test fixtures and the host-select tests.

crates/rustev-eval/src/selection.rs and host_select.rs

  • Baseline integrity is computed once before the per-candidate loop and filtered with filter(|_| base.is_ok()). When the baseline fails its binding check, precondition_reason is already Some(...), so the integrity block is skipped — no double-reporting.
  • breached matches on .integrity suffix, which covers baseline.runs[N].integrity and candidate.runs[N].integrity correctly.
  • Integrity clauses are inserted after preconditions and before coverage, confirming the ordering required by 3.3.

crates/rustev-cli/src/repeat.rs

  • The notice injection is guarded by both done.code == 12 and clause.ends_with(".integrity"), so it only fires for integrity-void candidates, not for other unknown-status candidates.
  • Goldens confirm notice appears in stdout but not in the --out JSON file. The .json golden for integrity-void has no notice field; the .stdout golden has it. This matches the spec's 3.4.3 requirement.

Spec lifecycle

  • implementation: pending → implementation: complete on an approved spec. Per the contract table, approved + complete is settled (not schedulable, unresolved units are errors). The approval claim (A-84, 2026-11-06) was already in the base commit; this PR only records the implementation conclusion.

Goldens cross-check

  • integrity/holds golden: candidate qualifies (exit 0), no notice. ✓
  • integrity/reject golden: candidate rejected on require[0] (exit 11), no notice. ✓
  • integrity/baseline and integrity-void goldens: notice present on every candidate with an .integrity unknown verdict. ✓
  • host-mixed: "good" qualifies, "bad" gets notice; ranked: ["good"]. ✓

No concrete defects found.

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

Subject: ce699ae...e33a411, diff digest 2ccfc9b65b956ae95c431a12f337beb6f5f5920287e2f10089c27823562f967e, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 35ab7e5 Nov 7, 2026
26 checks passed
@bartekus
bartekus deleted the impl/065-complete branch November 7, 2026 22:48
bartekus added a commit that referenced this pull request Nov 8, 2026
…derive PlanId-keyed baselines, ledgers and caches

The release family moves from `0.6.0` to `0.7.0` in lockstep. The owner
authorized on 2026-11-08 opening the cycle of the release after 0.6.0
(tagged at `8e9599ac`, published to crates.io and npm) as 0.7.0, carrying
spec 068's implementation and the later work of the cycle. The move lands
first in the cycle, on a quiet `main`, so that a change in the cycle that
spec 031 3.8's npm declaration check (`make semver`,
`tools/rustev-release/npm-api-diff.mjs`) or `cargo semver-checks` classes
as breaking over the 0.6.0 baseline is reported rather than refused.
Before 1.0 the breaking position is the minor number. No behavior
changes. The same procedure as #545, #528, #511 and #480.

- **Why a minor step:** the next release is 0.7.0 (spec 068 and the later
work of the cycle); a `0.x` family takes a break in its minor version, so
`cargo semver-checks` and the npm check against 0.6.0 report rather than
refuse.
- **Version sites:** the workspace `version` and its internal `=0.7.0`
pins (the same thirteen as #545; no family crate joined the root
`[workspace.dependencies]` since 0.6.0), `Cargo.lock`, the nine npm
`package.json` files, and `tools/rustev-release/release-set.json`
(version and tag `v0.7.0`).
- **Regenerated fixtures:** spec 002 3.3.4 puts `rustev-core/<crate
version>` in every plan document, so every PlanId moves, and everything
derived from one: `RUSTEV_BLESS=1 UPDATE_REPEAT_GOLDENS=1
UPDATE_SELECTION_GOLDENS=1 UPDATE_HOST_GOLDENS=1
UPDATE_INTEGRITY_GOLDENS=1 cargo test --workspace` (the integrity
goldens are new since 0.6.0, spec 065), `make conformance-harvest`, the
embed-linear ignored bless test
(`support_routing::fixtures::bless_support_routing_fixtures`) and the
local-embed conformance bless (`support_routing::conformance::`, which
writes `local-embed.support-routing`), the byte copies #480 lists (core
`src/testdata`, `rustev-otel` plan fixtures from the harvested
`lodging.run` and `support.run` fixtures), the two copy checks refreshed
from their sources (`rustev-bedrock` `reference-plan-ids.json` from the
core `*.plan-id` goldens; `rustev-eval` `lodging-emb.record.json` from
the harvested `lodging.replay` bundle's retained bytes), and the
`rustev-serve` Sigstore fixture re-signed with its throwaway local keys
(four-argument `regenerate_sigstore.py`, over the registration with the
new PlanId and its `PlanBundleSignature::signing_input()` bytes). New
since 0.6.0 and regenerated through the same paths: spec 067's native
live conformance cases (`live.journal-cap`, `live.probe-failure`,
`live.probe-only`, `live.run-cap`) and their fixtures, and spec 065's
`integrity-void` case. The diff is hashes, version strings, recorded
timing and the re-signed throwaway certificates; a script compared every
changed fixture against `main` with 64-hex digests, `0.6.0`/`0.7.0` and
the run-record timing fields masked, and found no other difference.
- **Spec 058:** a dated record entry for the 0.7.0 move: a
breaking-position release; every PlanId changes from 0.6.0 to 0.7.0 and
anything keyed by one must be re-derived on upgrade.
- **Release notes:** this title (the squash subject) carries the
re-derive note, so the 0.7.0 changelog states it.
- **`.statecraft/derived`:** refreshed (root `Cargo.toml` is a hashed
input; the spec edit).

Left unchanged on purpose: historical text naming 0.6.0 (spec records,
decision rows, spec 068's baseline), synthetic versions under test in
`tools/rustev-release/tests`, and third-party crates at 0.6.0 in
`Cargo.lock`.

Also left unchanged: the harvest writes `"surfaces": ["cli", "native"]`
for `cli/integrity-void.stdout` (every repeat command runs natively too,
`crates/rustev-cli/tests/common/harvest.rs`), while `main` (#554)
commits `["cli"]`. That drift predates this change and is not a version
effect, so this pull request keeps `main`'s surfaces in the case and the
manifest and changes only the case's hashes.

All local, on build lane 2:

- Bless and harvest paths: a core bless and the `src/testdata` copies
first, then the workspace bless, then (as in #545, the first harvest
stopped on a CLI test that had compiled the old core golden bytes) the
CLI cases and fixtures restored from `main`, a CLI bless, `make
conformance-harvest` (pass), the embed-linear and local-embed blesses,
the manifest aggregate, the copies and the Sigstore re-sign. A second
full workspace bless pass ran with 0 failures and changed nothing
further.
- `make refresh` (the spec edit staled three shards), `make gate`,
`scripts/check-authored-content.sh`: clean.

`couple`: the regenerated fixtures are claimed through many specs'
`extends` whose text this change does not touch. Spec 058 carries the
authoring edit; the remaining paths are covered by the owner's waiver,
as in #480, #511, #528 and #545.

Policy isolation (`guard-policy-files.sh`): this change touches
`Cargo.toml` and `Cargo.lock` beside the fixtures, so governance's
"Policy isolation" step is expected to fail. It cannot be split into
parts that pass on their own: a pull request with only `Cargo.toml` and
`Cargo.lock` fails its own tests (every PlanId fixture is stale), and
one with only the fixtures fails against the 0.6.0 crates. As with
bypassing only that guard, once every other check passes (code, verify,
bindings, release-checks with semver, boundaries, and the AI review).
The merged commit is never tagged: the 0.7.0 tag goes on a later commit
whose own ci-gate passed.

Spec-Drift-Waiver: family version bump to 0.7.0 (the release after
0.6.0; the owner authorized opening the 0.7.0 cycle on 2026-11-08),
moved to the start of the cycle so that breaking changes over the 0.6.0
baseline are reported rather than refused. Every PlanId embeds the
compiler crate version (spec 002 3.3.4), so fixtures are regenerated
mechanically through their bless and harvest paths; no behavior changes.
Authorized by the owner on 2026-11-08.

Labelled `statecraft:stacked-ci` so this pull request's own run covers
every acceptance group, release-checks and bindings: an admin merge
skips the merge queue's full run.
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