Skip to content

impl(044): increment 8, the production batching posture - #452

Merged
bartekus merged 1 commit into
mainfrom
impl/044-increment-8
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/044-increment-8

Conversation

@bartekus

@bartekus bartekus commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Spec 044 increment 8. Spec 022 is complete, so this lands the later increment that A-49 set aside: 3.8 item 4, R-2's construction check batch_unqualified, and the section 5 row "A production binding enables batching without a qualified report".

Change

JevBackend::new_production now takes the cited rustev.batch-qualification/1 report beside the accepted qualification. A production binding with batching on constructs only when all of these hold:

  • the report checks, meaning its recorded verdict equals the derived one;
  • its verdict is qualified;
  • its batched identity is this binding's;
  • its unbatched identity is this binding's with only the batching switch off;
  • its batching configuration matches this binding's item cap and window.

Otherwise construction fails with batch_unqualified before any credential lookup. This replaces spec 022 3.7.5 item 4's interim refusal.

Other details:

  • A constructed backend records the cited report's digest in each exchange record's privacy_requested, as batch_qualification. A binding with batching off ignores any report it is given and keeps its records unchanged.
  • The check is rustev_jev::production::check_batch_qualification. rustev-jev now depends on rustev-eval outside its tests. rustev-live already did, and Cargo.lock is unchanged.
  • Citing a report grants nothing. No report in the repository is qualified: the Jev stage 2 measured not_qualified. So no production binding can enable adapter-scoped batching today, and enabling it stays the owner's act (R-28).

Specs:

  • 044 gains the increment 8 record. Its Verification block gains cargo test -p rustev-jev --locked --test production. Its open list now keeps only stage 2 for the remote-http adapter, so 044 stays implementation: in-progress.
  • 022 gains a dated record paragraph. It notes that section 5's "batching on" row holds as 3.7.5 item 4 reads it: batching on without a qualified report.
  • status: is unchanged in both specs.

Tests

Three new tests in integrations/rustev-jev/tests/production.rs:

  • production_batching_requires_a_cited_qualified_report_before_credentials covers each refusal case:

    • no report;
    • unknown and not_qualified reports;
    • a forged verdict;
    • another binding, or another unbatched identity;
    • another item cap or window.

    Each must give batch_unqualified with no credential lookup. A cited report without the acceptance record is still refused.

  • production_batching_records_the_cited_report_digest

  • production_without_batching_ignores_a_report_and_records_none

Checks

  • cargo test -p rustev-jev --locked --test production
  • cargo clippy -p rustev-jev --all-targets -- -D warnings
  • cargo fmt --all --check
  • make boundaries
  • make gate
  • bash scripts/check-authored-content.sh

No live or paid call.

A production Jev binding with batching on constructs only with a cited rustev.batch-qualification/1 report that checks, is qualified, and names this binding with batching on and off at its batching configuration; otherwise construction fails with batch_unqualified before any credential lookup (3.8 item 4, R-2, section 5). The cited report's record digest is named in each exchange record. This replaces spec 022 3.7.5 item 4's interim refusal.
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for concrete defects across all changed paths.

integrations/rustev-jev/src/production.rs — check_batch_qualification

The implementation sequences the checks correctly:

  1. report.check() — verifies the internally-derived verdict matches the stored field, catching the forged-verdict case before the explicit Verdict::Qualified test.
  2. Verdict equality — catches Unknown / NotQualified.
  3. Binding identity — both batched and unbatched artifacts must match.
  4. Batching configuration — max_items and window_ms checked against the live binding.
  5. Digest extraction.

The batch() early-return for non-batched bindings (Ok(None)) silently ignores any supplied report, which the spec explicitly requires ("ignores one supplied") and is confirmed by production_without_batching_ignores_a_report_and_records_none.

integrations/rustev-jev/src/adapter.rs — new_production

check_batch_qualification runs before the acceptance-qualification check, so a batched binding with no batch report gets batch_unqualified before any credential callback is invoked. The test's count == 0 assertions confirm credentials are never read on failure paths.

Arc::get_mut(&mut backend.inner).expect("new instance") is a runtime panic on any future change that causes inner to have more than one strong reference at construction time. The sink arc is stored in the backend but inner is a distinct arc; this assumption holds for the current construction path. No concrete defect is evidenced by the supplied diff.

integrations/rustev-jev/Cargo.toml

rustev-eval is promoted to a regular dependency. rustev-jev is under integrations/, so the boundary rule is satisfied. The comment on the dev-dependencies block is updated to note that the parameterized feature is what the test side still needs there; the two entries serve different feature sets and Cargo merges them, which is standard.

integrations/rustev-jev/tests/production.rs

Test coverage is comprehensive: eight rejection cases (no report, Unknown, NotQualified, forged verdict, another binding identity, swapped unbatched identity, wrong item cap, wrong window), the "cited report never substitutes acceptance record" guard, the digest-is-recorded path, and the no-report-recorded-for-unbatched path. The credential-count guard (count == 0) is checked after every failure case.

Spec documents

The spec 022 implementation record correctly describes the change in scope of its item 4 refusal (from "refuse all batching on" to "refuse without a qualified report"), and spec 044's increment 8 entry is self-consistent with the code changes.

No concrete defect found.

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

Subject: 50ca9ad...e9d29e0, diff digest 09d509811fd5e06448e63e1511e9f99b4dd44ade502fdcd9c3ff2ffcbbcdec00, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge November 2, 2026 19:57
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 8f8f87d Nov 2, 2026
30 checks passed
@bartekus
bartekus deleted the impl/044-increment-8 branch November 2, 2026 23:51
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