Skip to content

impl(031): increment 1, the facade crate and the two new members - #142

Merged
bartekus merged 1 commit into
mainfrom
impl/031-facade
Oct 21, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/031-facade

Conversation

@bartekus

@bartekus bartekus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Spec 031 increment 1: the facade crate rustev, its boundary rules, and rustev-pkg-lodging and the facade joining the release family.

  • integrations/rustev/ (new, crate rustev): #![forbid(unsafe_code)], no binary. rustev::contract and rustev::decision_core always (3.2.1); features runtime, eval, rules, remote-http (the four whose crates are in this release, 3.4), each dep: exactly one optional dependency and gating one module named after it; default = []; documented with module, crate and subset (3.2.5).
    • tests/public_items.rs: the source is only those re-exports; each feature enables exactly its one dep:; default is empty; every feature is documented.
    • tests/plan_ids.rs (3.7): both reference plans compiled through rustev::decision_core from the conformance suite's pinned plan check fixtures equal the plan identities the CLI goldens pin. Passes with no feature and with all features.
  • tools/rustev-boundaries (3.3): FacadeIntegration (an integration dependency of the facade that is not optional, not normal, or not enabled by exactly one feature), DependsOnFacade (any workspace crate, any dependency kind), FacadeDefault (non-empty default), FacadeFamily (the facade naming an ecosystem, HTTP or binding family itself), and the facade's no-feature graph checked transitively like the pure crates. Integration crates still may not depend on one another. Eight synthetic-metadata fixtures.
  • tools/rustev-release:
    • release-set.json: rustev-pkg-lodging in layer 3 (uploading after the CLI it dev-depends on, as support-routing does); rustev alone in a new last layer, uploading last; lodging's exclusion removed.
    • policy: only the facade may declare features, each exactly one optional normal dependency on a release member (I-3: a feature for a crate outside the release fails), and a non-empty default fails (FacadeFeature); the facade's layer is the last one and the set refuses a facade sharing it or not uploading last. Tests for each; three existing tests that used lodging as their excluded example now use rustev-boundaries.
    • archive-policy.json: the reviewed file lists of both new archives (equal to cargo package --list, which the existing test checks).
  • packages/rustev-pkg-lodging: family metadata, publish = ["crates-io"], include, LICENSE, workspace dependencies (031 amends 008's out-of-scope publication). Its tests pass unchanged.
  • Workspace Cargo.toml: the two packages as exact-pinned workspace dependencies.
  • Spec 031: integrations/rustev/ established (no longer planned), an extends edge for lodging's LICENSE, implementation record.

Later increments: subset jobs, MSRV and semver checks, SBOMs, the changelog, the extended dry run and the release workflow.

Local verification (macOS arm64): cargo test -p rustev (with no feature and with --all-features), cargo test -p rustev-boundaries (28), cargo test -p rustev-release (all pass, manifests 17), cargo test -p rustev-pkg-lodging, make boundaries, cargo clippy --workspace --all-targets -D warnings and -p rustev --all-features, cargo fmt --check, make gate, bash scripts/check-authored-content.sh.

Review round 1 (3 findings: 1 fixed, 2 answered in the diff):

  1. "The last-layer test calls check_manifests, but the message comes from check_set." check_manifests begins with let mut v = check_set(set);, so it carries that verdict; the test passed locally. A comment at the test now says so.
  2. A facade feature naming a crate outside the release produced two violations (not a member, and not a dependency). Fixed: the membership violation is the only one (continue), and the test now asserts exactly one violation with only().
  3. "README.md is not in the facade's or lodging's archive." It is: Cargo adds the workspace README.md that readme.workspace names regardless of include, cargo package --list -p rustev prints it, and tests/archives.rs (the_reviewed_lists_equal_cargo_package_list) checks the reviewed lists against that output and passes. Both manifests now say so beside include.

Review round 2 (2 findings, fixed):

  1. A workspace crate depending on the facade was reported twice (DependsOnIntegration, since the facade lives under integrations/, and DependsOnFacade). A dependency on the facade is now DependsOnFacade alone; the fixture uses rustev-eval (which no other rule restricts) and asserts exactly that one violation for normal, dev and build dependencies. The "integration crates still may not depend on one another" fixture now has a second integration crate depending on the remote binding and asserts exactly DependsOnIntegration.
  2. every_feature_is_documented indexed entries[0]; a feature enabling nothing now fails with a message naming it.

Review round 3 (2 findings, fixed): tests/public_items.rs no longer parses Cargo.toml by hand; it reads the facade's features from cargo metadata --no-deps (Cargo's own parse), and compares the declared features with the gated modules as sorted sets, so neither file's order matters.

Rebased onto main after #138 to #141 merged (derived shards regenerated).

Review round 4 (1 finding, fixed): the facade's archive bounds (128 KiB compressed, 256 KiB unpacked) were looser than lodging's although the facade holds less. They are now 64 KiB compressed and 128 KiB unpacked, the ceilings of the other small library crates: its archive is src/lib.rs, the workspace README and LICENSE (16.5 KB together), the manifests and a Cargo.lock of its all-features graph (about 25 KB). The release candidate measures every archive against these bounds and fails on any excess.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at this PR, which introduces the rustev facade crate, boundary rules for the facade, and release validation, I found the following issues:

1. Test calls wrong function for "not alone in last layer" assertion

In tools/rustev-release/tests/manifests.rs (the the_facade_is_alone_in_the_last_layer_and_uploads_last test), the first case calls check_manifests(&s, &metadata()) but expects a Violation::ReleaseSet { detail } containing "not alone in the last layer". That message is produced by check_set, not check_manifests. The check_set function is where the new check lives (it iterates seen, checks set.layers.last(), and calls its bad closure). If check_manifests does not delegate to check_set, the .any(...) predicate will never be satisfied and the assert! panics — the test fails rather than verifying the intended constraint. The upload-order case in the same test correctly uses check_set.

2. Double violation for unreleased feature dependency

In tools/rustev-release/src/lib.rs check_facade_features: when a feature names a crate that is not a release member (e.g. dep:rustev-bedrock), the code first emits "not a member of this release" and then falls through to the declared check, which also fires ("not an optional normal dependency") because rustev-bedrock is absent from p.dependencies. Two distinct FacadeFeature violations are emitted for one feature. The existing test uses .any() so it passes, but any future test using only() for this path would unexpectedly see 2 violations. A continue after the membership check would prevent the redundant emission.

3. archive-policy.json lists README.md for rustev but include excludes it

integrations/rustev/Cargo.toml declares include = ["/src/**/*.rs", "/LICENSE"]. The archive-policy.json entry for rustev lists "README.md" as an expected archive file. Cargo auto-includes the path named by the readme field independent of include, but readme.workspace = true points to the workspace root README.md, which is outside the package directory — Cargo does not copy it into the archive in that case. The same applies to rustev-pkg-lodging, which has include = ["/src/**/*.rs", "/data/**/*.json", "/LICENSE"] but lists README.md in its archive-policy entry.

{"head": "bd012cdc5eb8c31d0589aea4e9453d335f53cc10", "verdict": "findings", "findings": [{"path": "tools/rustev-release/tests/manifests.rs", "line": 278, "summary": "The first case calls `check_manifests` but the 'not alone in the last layer' violation is emitted only by `check_set`; if these functions are not composed, the assertion never fires and the test fails."}, {"path": "tools/rustev-release/src/lib.rs", "line": 554, "summary": "When a facade feature names a crate outside the release, `check_facade_features` emits two violations for the same feature (both 'not a member' and 'not an optional normal dependency') because it does not short-circuit after the membership check."}, {"path": "tools/rustev-release/archive-policy.json", "line": 270, "summary": "`README.md` is listed in the `rustev` archive-policy entry but the facade's `include = [\"/src/**/*.rs\", \"/LICENSE\"]` excludes it, and `readme.workspace = true` pointing to the workspace root is not copied into the package archive by Cargo."}]}

Subject: cbd5bfb...bd012cd, diff digest 57b2fad1e24833e7e644bd15bf0b45dc228f9e5b0e1932080e0559eb45693f7d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 10:11 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the PR, which introduces the rustev facade crate, boundary enforcement for it, and promotes rustev-pkg-lodging to a publishable member.

Key findings

Double violation when a workspace crate depends on the facade

In tools/rustev-boundaries/src/lib.rs, the DependsOnIntegration check and the new DependsOnFacade check are independent rather than mutually exclusive. When any workspace crate depends on rustev, the facade is in integration_names (it lives under integrations/), so the else branch of the integration check fires and emits DependsOnIntegration. The separate if dep.name == FACADE block then also emits DependsOnFacade. Both report the same dependency from different specs.

// fires for rustev-core → rustev
} else {
    out.insert(Violation::DependsOnIntegration { krate: pkg.name.clone(), dependency: dep.name.clone() });
}
// also fires, independently
if dep.name == FACADE && member_names.contains(FACADE) {
    out.insert(Violation::DependsOnFacade { krate: pkg.name.clone() });
}

The test at line ~1196 only asserts v.contains(&Violation::DependsOnFacade {...}) and never checks for the absence of DependsOnIntegration, so the duplication is invisible to the test suite. A developer violating 031 3.3.2 would see two violations for a single dependency, the less-informative DependsOnIntegration ("depends on the integration rustev") alongside the specific DependsOnFacade. The DependsOnIntegration check should skip when dep.name == FACADE (mirroring how it skips when pkg.name == FACADE).

entries[0] panic in every_feature_is_documented

integrations/rustev/tests/public_items.rs line ~128: if a non-default Cargo feature has an empty enables list (foo = []), entries[0] panics with an index-out-of-bounds rather than producing a readable assertion failure. The other test (the_source_is_only_reexports) would also catch this state, but the panic in this test produces a worse diagnostic.

{
  "head": "8a0bf086d86537ad6c79d331f015ee2107eb9cfc",
  "verdict": "findings",
  "findings": [
    {
      "path": "tools/rustev-boundaries/src/lib.rs",
      "line": 352,
      "summary": "When a workspace crate depends on the facade, both DependsOnIntegration and DependsOnFacade are raised for the same dependency because the two checks are independent — the facade's name should be excluded from the DependsOnIntegration else-branch."
    },
    {
      "path": "integrations/rustev/tests/public_items.rs",
      "line": 128,
      "summary": "entries[0] panics with index-out-of-bounds rather than failing cleanly if a non-default feature has an empty enables list."
    }
  ]
}

Subject: cbd5bfb...8a0bf08, diff digest 22aee20e66721e2760b14dc4e101d8450fe37c21ccbebfffe4af772fcd5ef112, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 10:47 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reading the diff carefully, focusing on the boundary checker, release tooling, and facade test logic.

Finding 1 — order-sensitive assertion in the_source_is_only_reexports

integrations/rustev/tests/public_items.rs, around line 121:

let named: Vec<&str> = declared.iter()
    .map(|(n, _)| n.as_str())
    .filter(|n| *n != "default")
    .collect();
let gated_names: Vec<&str> = gated.iter().map(|(f, _)| f.as_str()).collect();
assert_eq!(named, gated_names, "every feature gates exactly one module");

named is in Cargo.toml textual order; gated_names is in lib.rs source order. The assertion uses assert_eq! (order-sensitive), but the spec constraint it verifies ("every feature gates exactly one module") is a set property, not an ordering property. Reordering features in Cargo.toml without touching lib.rs (or vice versa) will fail this test with a message that says "every feature gates exactly one module" when both the sets and their contents are identical — a misleading diagnostic.

Finding 2 — fragile homegrown TOML parser

integrations/rustev/tests/public_items.rs, lines 40–59:

let table = MANIFEST
    .split("\n[features]\n")
    .nth(1)
    ...
    .split("\n[")
    .next()
    .unwrap();

The split on the literal "\n[features]\n" will silently produce wrong results if the section heading is preceded by a blank line (\n\n[features]\n), followed by a comment, or if a future feature value spans multiple lines (legal TOML). It only works because the current Cargo.toml happens to use the exact delimiters the parser expects. A mis-parse would not panic — it would silently drop features, causing assert_eq!(named, gated_names) to fail with a confusing mismatch.

Everything else looks correct.

The boundary check for FacadeIntegration correctly distinguishes normal/non-normal, optional/required, and feature-count violations, and the early-exit ordering is intentional. The DependsOnFacade / DependsOnIntegration split correctly excludes the facade name from DependsOnIntegration. The check_set facade-placement guard (last layer alone, uploads last) and the corresponding check_manifests layer adjustment (expected.max(set.layers.len())) are consistent with the release-set shape. The check_facade_features logic for rustev-release correctly catches unreleased crates, multi-dep features, non-dep: entries, and non-optional declarations. Archive policy entries, workspace dependency updates, and the Cargo.lock addition all look consistent.

{"head": "5772ac7929360fc6778212d30a11cddda9b03fc6", "verdict": "findings", "findings": [{"path": "integrations/rustev/tests/public_items.rs", "line": 121, "summary": "assert_eq!(named, gated_names) enforces the same ordering between Cargo.toml features and lib.rs re-exports, which is stricter than the spec constraint being verified (a set property, not an order property), and will produce a misleading failure message if either file is reordered independently."}, {"path": "integrations/rustev/tests/public_items.rs", "line": 41, "summary": "The homegrown TOML feature parser splits on the literal string \"\\n[features]\\n\" and strips brackets with trim_start/end_matches, so a blank line before the section heading, an inline comment, or a future multi-line feature value will silently mis-parse rather than fail fast."}]}

Subject: cbd5bfb...5772ac7, diff digest 55906e786a9f776cdf045c41b72649c84ce2ee0e5f78a65b51ac340656528e79, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 11:23 — with GitHub Actions Error
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff carefully across all changed paths.

integrations/rustev/Cargo.toml — facade shape looks correct: no default features, four optional deps each behind exactly one named feature, publish = ["crates-io"], include covers only /src/**/*.rs and /LICENSE.

integrations/rustev/src/lib.rs — thin re-export file, #![forbid(unsafe_code)], two always-present modules, four gated modules each matching their feature name. No definitions of its own.

integrations/rustev/tests/plan_ids.rs — reads fixtures from the conformance suite at two levels up via CARGO_MANIFEST_DIR; tests are excluded from the published archive (include omits tests/), so path assumptions only apply during development. Correct.

integrations/rustev/tests/public_items.rs — every_feature_is_documented builds the substring | \{name}` | `{module}` | `{krate}` |and checks it against the raw source string (not the filtered code lines), so it correctly matches doc-comment table rows.the_source_is_only_reexports` enforces ordering of the always-present pair and identity of gated features vs declared Cargo features. Logic is sound.

tools/rustev-boundaries/src/lib.rs — three new checks (FacadeIntegration, DependsOnFacade, FacadeFamily) are independent if blocks, not else if, so they compose correctly. The dep.name != FACADE guard in the DependsOnIntegration branch ensures a dep on the facade is only classified as DependsOnFacade, not also as DependsOnIntegration. Transitive-purity check extended to the facade (empty default features → optional deps absent from resolve graph) is correct.

tools/rustev-release/src/lib.rs — facade layer check uses set.layers.len() as the expected layer index. With 1-based layer numbering (layer_of returns 1 for the first layer), set.layers.len() equals the last layer index, so expected.max(set.layers.len()) correctly forces the facade to the last position. The upload-order and layer checks are gated on seen.contains(FACADE), avoiding false positives when no facade is in the set.

tools/rustev-release/tests/manifests.rs — the old upload_order.pop() would have removed rustev (now the last element), triggering both the "does not upload last" check and the permutation check (two violations) and breaking the assert_eq!(..., 1) assertion. The replacement retain(|n| n != "rustev-core") removes a middle element, leaving the facade at the tail and producing exactly one permutation violation. The test changes from rustev-pkg-lodging to rustev-boundaries in the exclusion tests are correct since lodging is now a release member.

tools/rustev-release/archive-policy.json — both new entries follow the same format as existing ones; max_unpacked_bytes for lodging (196 KB) accommodates the JSON data files; the facade's limits (128 KB / 256 KB) are conservative for its tiny source but consistent with other crates' headroom.

tools/rustev-release/release-set.json — facade is alone in the last layer and last in upload order; lodging joins layer 3 (alongside eval, runtime, etc.) and uploads after cli; both consistent with spec 031 3.1.

No bugs, security problems, or inconsistencies found.

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

Subject: cbd5bfb...26382b2, diff digest b57303e7bb3054845b0fd07088e9a7c303bbaa11bd45a2d95be098c871204f29, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (findings)

The PR introduces the rustev facade crate, promotes rustev-pkg-lodging to a published release member, adds boundary and release-set enforcement rules for the facade, and updates the archive policy. I reviewed each changed path for bugs, security issues, and inconsistencies.

tools/rustev-release/archive-policy.json – inverted archive limits

The rustev facade entry (max_archive_bytes: 131072 = 128 KB) is set to twice the limit of rustev-pkg-lodging (max_archive_bytes: 65536 = 64 KB), despite the facade shipping far fewer files (7 vs. 15+, and no data assets). The facade's source is a single 49-line lib.rs; its actual compressed archive will likely be under 10 KB. This makes the archive-size guard effectively inert for the facade and means the ceiling is the wrong way around relative to the two crates' actual sizes.

tools/rustev-boundaries/src/lib.rs – FacadeFamily fires on any dep kind

The FacadeFamily check (line ~330) fires for every dependency kind, including dev and build. If a test harness ever needs a direct dev-dependency on an HTTP crate for fixture purposes this would block it without a separate escape hatch, while the companion FacadeIntegration check explicitly distinguishes kinds. This is likely intentional per spec 031 3.3, but it is asymmetric with how FacadeIntegration is enforced and is worth a deliberate confirmation.

Everything else looks correct:

  • integrations/rustev/src/lib.rs: #![forbid(unsafe_code)], no definitions of its own, four optional features each gating exactly one dep:, empty default.
  • tests/public_items.rs: the every_feature_is_documented table-row check (| \remote-http` | `remote_http` | `rustev-remote-http` |) matches the actual doc table in lib.rs`.
  • tests/plan_ids.rs: fixture paths exist in the repo context; golden["plan_id"] and compiled.id serialisation path look correct.
  • Boundary rules: FacadeDefault, DependsOnFacade, FacadeIntegration logic and the transitive-purity extension for the facade are internally consistent with the test matrix.
  • Release-set checks: facade-last-layer / upload-last enforcement and check_facade_features logic are consistent; the a_cargo_feature_fails path through only() constrains the layer calculation to be correct.
  • Cargo.toml workspace additions, release-set.json upload order (lodging and facade appended after CLI), and rustev-pkg-lodging metadata changes (publish, include, workspace deps) all align with spec 031 intent.
{"head": "a8112c9b6d5c26222a1f14ec516e66bdbdc5d66f", "verdict": "findings", "findings": [{"path": "tools/rustev-release/archive-policy.json", "line": null, "summary": "The facade entry sets max_archive_bytes to 131072 (128 KB), twice the 65536 (64 KB) ceiling of rustev-pkg-lodging, despite the facade having far fewer files and no data assets, making the size guard ineffective for the facade."}]}

Subject: a99f7bf...a8112c9, diff digest 7745617ab4f71e38ca73c147bc8b1bc5e9ac4d3f5917ee2ffb9bbe0168c3ecf3, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 15:34 — with GitHub Actions Error
The facade rustev (no default features; runtime, eval, rules and remote-http each one optional dependency and one module), its boundary rules of 031 3.3, and rustev-pkg-lodging and the facade joining the release set, the facade alone in the last crate layer.
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR, which introduces the rustev facade crate (spec 031 increment 1), updates rustev-pkg-lodging to a publishable member, adds boundary and release-validation rules for the facade, and adjusts the release set and archive policy.

integrations/rustev/src/lib.rs — re-exports only, #![forbid(unsafe_code)], no definitions of its own; matches spec 031 3.2. ✓

integrations/rustev/tests/plan_ids.rs — path construction via concat!(env!("CARGO_MANIFEST_DIR"), "/../..") resolves to workspace root; fixture paths (tools/rustev-conformance/fixtures/cli/…, crates/rustev-cli/tests/golden/…) all exist in repo context. ✓

integrations/rustev/tests/public_items.rs — the_source_is_only_reexports validates source-manifest alignment; every_feature_is_documented constructs | \{name}` | `{module}` | `{krate}` |and usescontains`, which correctly matches partial table rows (trailing subset column present in doc). ✓

tools/rustev-boundaries/src/lib.rs — FacadeIntegration check (optional, normal, exactly one enabling feature), DependsOnFacade, FacadeDefault, FacadeFamily all look correct. The facade's optional integration deps are excluded from the transitive-purity graph because cargo metadata resolves them with default features (which are empty) so they don't appear in the resolved graph. Tests for the eight cases are thorough.

tools/rustev-release/src/lib.rs — layer check for the facade:

let expected = if *name == FACADE {
    expected.max(set.layers.len())
} else {
    expected
};

This forces the facade's expected layer to set.layers.len(). Its correctness depends on layer_of being 1-indexed (returning 1 for the first layer, N for the Nth). Confidence that this is right: the surrounding tests (the_facade_alone_may_declare_features_each_one_released_dependency, etc.) call only(check_manifests(&set(), &m)), which panics on ≠ 1 violation, so any spurious facade layer violation would break these tests. ✓

tools/rustev-release/tests/manifests.rs — the three tests that previously used rustev-pkg-lodging as the excluded crate have been correctly migrated to rustev-boundaries now that lodging is a member; the shape test for the_release_set_fixes_the_first_family is updated consistently. ✓

release-set.json — lodging placed in the correct concurrent layer; facade alone in the last layer, last in upload order (after the CLI that lodging dev-depends on). ✓

archive-policy.json — both new members listed; README.md appears despite not being in include = because Cargo automatically appends the readme-field file; comment in Cargo.toml acknowledges this. ✓

No bugs or security problems found.

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

Subject: a99f7bf...fd00730, diff digest 5183c3064c9714b764a5cd8dc896806f99241737cd97f4a129821129f96d62b2, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge (squash) October 21, 2026 16:17
@bartekus
bartekus merged commit 541f3ca into main Oct 21, 2026
7 checks passed
@bartekus
bartekus deleted the impl/031-facade branch October 21, 2026 16:32
bartekus added a commit that referenced this pull request Oct 21, 2026
Spec 027 increment 7, third change: the differential floating-point
corpus (3.11.3, 3.11.5).

After spec 047 (#138, #139) every transcendental call reachable from a
pure command is a call of `rustev_core::math`, at four sites: `exp` in
core's softmax, `ln` in core's calibration, `ln` in evaluation's log
loss, `ln` in its temperature fit.

- `tools/rustev-conformance/fp-corpus/` (new crate `rustev-fp-corpus`,
`publish = false`, excluded from the release set as tooling; an explicit
workspace member, since it sits inside the conformance suite's
directory):
- 131,072 inputs per site, drawn as each site sees them (non-positive
`exp` arguments; positive finite masses; probabilities in (0, 1] and
just above). Each set starts with boundary values: zeros, the smallest
and largest subnormals, `MIN_POSITIVE`, one ulp either side of 1, where
`exp` leaves the normal range and where it rounds to 0, and the format's
extremes. It continues with a seeded SplitMix64 using integer arithmetic
and correctly rounded basic operations only, so every target draws the
same bits.
- Per site, the SHA-256 of the input bits and of the output bits, both
committed in `expected.json`.
- A native runner (`rustev-fp-corpus check expected.json`) and a
WebAssembly build of the same crate with plain exports and no imports
(`corpus_sites`, `corpus_run`, `corpus_digest_byte`). The exports need
`#[unsafe(no_mangle)]`, so the crate relaxes `unsafe_code` to `deny` and
allows it on those three functions only; there is no `unsafe` block.
- Tests: every `rustev_core::math` call in the pure crates is a corpus
site and vice versa (a new call site cannot go unmeasured); the inputs
meet 3.11.3 (at least 100,000, no NaN, subnormal and extreme magnitudes,
distinct draws for the two evaluation sites); this target reproduces the
committed digests.
- `tools/rustev-conformance/js/fp-corpus.mjs`: the WebAssembly module in
Node and in headless Chromium against the committed digests, writing a
result document.
- `make bindings`: the corpus natively, then in Node and Chromium.
- Release set: `rustev-fp-corpus` excluded with its reason.
- Spec 027: implementation record.

Local verification (macOS arm64, before the rebase onto `main`): native,
Node 24.6.0 and Chromium 153.0.8010.12 agree on all four sites; `make
bindings` passes end to end with the corpus steps; `cargo test -p
rustev-fp-corpus` (3 tests); clippy `-D warnings`; `cargo test -p
rustev-release` with the new exclusion. Seeded check: putting the
platform's `exp` and `ln` back into `rustev_core::math` makes the native
macOS run differ from the committed digests and fail, while WebAssembly
(whose standard library already uses the pure implementation) still
matches. That is the divergence spec 047 removed. After the rebase:
`make gate`, `bash scripts/check-authored-content.sh`. The results on
every CI target come with the `bindings` job, the next PR.

Rebased onto `main` after #142 merged. One conflict, in
`tools/rustev-release/release-set.json`, resolved by hand: #142 removed
lodging's exclusion (lodging became a member), and this PR adds
`rustev-fp-corpus`'s, so the result keeps the new exclusion and not
lodging's.

Review round 1 (1 finding, fixed): `corpus_digest_byte`'s out-of-range
sentinel `u32::MAX` reaches JavaScript as -1 (a wasm `i32` result is
signed), so `b > 255` never caught it. The runner now accepts only
integers 0 to 255 and throws naming the value otherwise; the Rust doc
comment states the -1. Checked locally against the module:
`corpus_digest_byte(5, 0)` and `(0, 99)` return -1, which the new guard
refuses.

Review round 2 (2 findings, fixed):
1. `check` compared the committed file byte for byte, so a CRLF checkout
(Windows with `core.autocrlf`) would fail with correct digests; the
committed text is now compared with carriage returns removed.
2. The call-site guard stripped only `//` comments; it now scans code
alone, with line, block (nested) comments and string and character
literals blanked (`code_only`, with its own test), counts every
occurrence rather than one per line, and compares `/`-separated paths on
every host.

Local: `cargo test -p rustev-fp-corpus` 4/4, clippy `-D warnings`.

Review round 3 (1 finding, fixed): `code_only` did not blank raw string
literals. It now recognizes `r"..."`, `r#"..."#` with any number of `#`,
and the `br` forms (not when `r` ends an identifier), and the scanner
test includes a raw string and a raw byte string holding `math::exp(`
and `math::ln(`, which are not counted. Local: `cargo test -p
rustev-fp-corpus` 4/4, clippy `-D warnings`.

Rebased onto `main` after #146 (profile revision 17, spec-spine 0.31.0):
derived shards regenerated with spec-spine 0.31.0; no other conflict.
bartekus added a commit that referenced this pull request Oct 21, 2026
…checks (#143)

Spec 031 increment 2: the partial-adoption subsets, MSRV and
API-compatibility checks, as repository commands (3.5, 3.6.7, 3.8).

- `tools/rustev-release/adoption.sh` (`make adoption [subset ...]`):
each subset is a fresh consumer project outside the workspace (its own
empty `[workspace]`, the workspace's `Cargo.lock` and
`rust-toolchain.toml` copied in) depending on the facade by path with
`default-features = false` and exactly the subset's features (plus
`rustev-pkg-support-routing` for embedded decisions). Its test names
every module the subset takes and parses a definition through the
facade, and must run and pass (a build alone fails); `cargo tree -e
normal` must contain each chosen crate and none of the omitted ones
(tokio and hyper included where omitted). Subsets: documents (no
feature), embedded (`runtime`, `rules`), evaluation (`eval`), remote
over HTTP (`runtime`, `remote-http`), and `runtime`, `rules`,
`remote-http` alone. `serve`, `bedrock`, `typesafe`, `otel`,
`local-embed` print "skipped, not passed" with the reason their crate is
not in this release.
- `tools/rustev-release/msrv.sh` (`make msrv`): `cargo +<MSRV> test
--locked` of every release member, the MSRV read by the release policy
from the members' `rust-version`.
- `tools/rustev-release/semver.sh` (`make semver`): for each member, the
newest earlier non-yanked version in the crates.io sparse index; with
one, `cargo semver-checks check-release` at the exact pin 0.51.0
(refusing any other version); with none, `no-baseline`, written as "not
applicable, not passed". The npm packages report `no-baseline` while
unpublished and refuse a verdict once published until their declaration
diff exists; the service API has no crate in this release. Registry
reads only, with a project User-Agent; no credential.
- `Makefile`: `adoption`, `msrv`, `semver`.
- Spec 031: implementation record.

The CI jobs that will run these come in a later workflow change,
together with spec 027's `bindings` job (one
`statecraft-review-exception` approval); this PR changes no workflow.

#142 has merged; this PR is rebased onto `main`.

Local verification (macOS arm64):
- `make adoption`: all 7 subsets pass (normal graphs of 30 to 62
crates), 5 skipped with reasons.
- `make semver`: 11 crates and 2 npm packages `no-baseline`; nothing
compared.
- `make msrv`: every member builds at 1.88 and its tests started, but
this Mac's `syspolicyd` held the freshly built CLI binaries in
`_dyld_start` for over 20 minutes in `rustev-cli`'s `actionability`
test, so I stopped it; the MSRV test run is not locally verified. The CI
job is the verdict.
- `make gate`, `bash scripts/check-authored-content.sh`.

Review round 1 (3 findings, fixed):
1. The record said the CI jobs "are registered"; no workflow changes
here. It now says they will be registered by a later workflow change,
with spec 027's `bindings` job, and that this increment changes no
workflow (this body likewise).
2. `semver.sh` created a temporary file per crate outside any trap; it
now uses one scratch directory removed by an `EXIT` trap.
3. `adoption.sh` matched `test result: ok. 1 passed` as a regex; it is
now a fixed-string match (`grep -qF`).

Review round 2 (2 findings, both mistaken, answered in the diff):
1. "`process.argv.slice(1)` is off by one under `node -e`." Under `-e`
there is no script path, so the first argument after the program is
`argv[1]`: `node -e 'console.log(process.argv.slice(1))' a b` prints
`["a","b"]` (checked on Node 24). A comment at the call now says so, and
the local `make semver` run read the index responses this way.
2. "The documents subset references `rustev::decision_core::compile`,
which may be feature-gated." It is not: `contract` and `decision_core`
are the facade's always-present modules (031 3.2.1, `#[cfg]`-free in
`lib.rs`, checked by `tests/public_items.rs`), and the documents subset
passed locally. A comment in the generator now says so.

Review round 3 (1 finding, the round-2 claim again, made moot): the
index file and version now reach the inline script as environment
variables (`INDEX_FILE`, `CURRENT`) rather than arguments, so no
argument indexing remains to dispute. Checked locally on a synthetic
index (`0.0.9`, `0.1.0`, yanked `0.0.5`, current `0.1.0`): it selects
`0.0.9`.

Review round 4 (3 findings: 2 fixed, 1 answered in the diff):
1. The consumer ran without `--locked`. `--locked` cannot hold for a
fresh consumer (the copied lockfile names the workspace's packages,
which the consumer's root replaces), so the guarantee is now checked
directly: after the build, every registry package in the consumer's
lockfile must be at a version the workspace's `Cargo.lock` pins, or the
subset fails naming it. Seeded locally on a copy of the lockfile:
identical gives nothing; `serde` at `9.9.9` is reported.
2. `curl` had no timeout; every registry request now has `--max-time
60`.
3. "`use rustev::contract::Document` is unused." It is the trait whose
`parse` the generated test calls (`Definition::parse` is
`Document::parse`); a comment in the generator now says so.

Review round 5 (1 finding, answered and guarded): "a pre-release family
version makes the comparator return NaN." The release policy refuses any
family version that is not `X.Y.Z` (`check_set`, 021 3.2), so none
reaches this script. `semver.sh` now also refuses a non-`X.Y.Z` version
itself before comparing (checked locally: `0.1.0` accepted, `0.1.0-rc.1`
and `1..0` refused).

The previous round's review was cancelled at its time limit; it was
rerun once by re-signing the commit.

Review round 6 (4 findings, fixed):
1. A four-part version passed the shape check; the family version must
now have exactly two dots and digits only.
2. The consumer's edition was hard-coded; it is now the workspace's own
`edition`, read from the root manifest (refusing when absent).
3. Whether the subset test ran was read from the harness's summary text;
the generated test now writes a mark file (`RUSTEV_ADOPTION_MARK`) and
the script checks that file instead.
4. The pinned `cargo-semver-checks` was probed only when a baseline
existed; it is now required up front on every run (exact version), so a
missing or wrong tool is found before the first release needs it. The CI
job installs it.

Review round 7 (1 finding, answered and made explicit): "a failing
`node` leaves `baseline` empty and reads as `no-baseline`." In POSIX
`sh` an assignment's exit status is its command substitution's, so `set
-e` already stops the script (`sh -c 'set -eu; b=$(false); echo
reached'` prints nothing and exits 1). The lookup now also has an
explicit `|| { ...; exit 1; }` naming the crate ("could not read its
index response; no verdict"), checked against a non-JSON index file.

Rebased onto `main` after #142 merged. The round-7 review (on `3451a98`)
repeated the `node` substitution finding, which `3305bd4` had already
answered with the explicit guard (`|| { echo "$name: could not read its
index response; no verdict" >&2; exit 1; }`); that head's review was
cancelled at the time limit, so this push is its rerun.

Review round 8 (3 findings, fixed):
1. A missing `node` surfaced as "could not read its index response":
`semver.sh` now checks `git`, `cargo`, `curl` and `node` on PATH before
anything else and names the missing one.
2. `make semver` computed the report path with an inline `node` call, so
a missing `node` gave `/semver.txt`: the script now defaults the report
to `semver.txt` in the cargo target directory it already resolves, and
the Makefile target passes nothing.
3. `adoption.sh` ignored an unknown subset name: a requested name that
is neither a present nor a skipped subset now exits 2 naming it (checked
locally: `adoption.sh nosuch` gives "no subset named 'nosuch'").

Review round 9 (1 finding, mistaken, answered in the diff): "`IFS='|'`
on `read` persists into the loop body, so the lists split as one token."
A prefix assignment to a regular built-in such as `read` lasts for that
command only (POSIX); `sh -c 'printf "a|x y z\n" | while IFS="|" read -r
n l; do for c in $l; do echo $c; done; done'` prints `x`, `y`, `z` on
separate lines (macOS `sh` and `bash`). The local adoption run is the
same evidence: the embedded subset's chosen-crate check passed over
three names, which it could not with `|` as the separator. A comment at
the loop now says so.

Review round 10 (1 finding, fixed): an empty member list from the
release policy would have run `cargo test` over the whole workspace;
`msrv.sh` now refuses an empty package list or MSRV.

Review round 11 (1 finding, fixed): Node's role in `semver.sh` is now
documented where a user meets it: the script's header, the Makefile
target's comment and the spec record each state that `make semver` needs
`curl`, Node 20 or later (to read the index's JSON lines) and the pinned
`cargo-semver-checks`; the script still refuses each by name when
missing.

Rebased onto `main` after #146 (profile revision 17, spec-spine 0.31.0):
derived shards regenerated with 0.31.0.

Review round 12 (3 findings, fixed):
1. The pinned `cargo-semver-checks` is now checked with the other tools,
before anything is built.
2. Node's version is checked too (20 or later), not only its presence.
3. Both remote subsets now require `tokio` in their graph (the remote
binding depends on it normally), as the runtime-only subset does.

Review round 13 (1 finding, fixed): the embedded subset (which enables
`runtime`) now also requires `tokio` in its graph, like every subset
that takes the runtime or the remote binding.

Rebased onto `main` after #145 merged (derived shards only).
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