Skip to content

072 increment 3, step 1: rustev-eval's dependency test admits schemars - #591

Merged
bartekus merged 1 commit into
mainfrom
impl/072-inc3a-deptest
Nov 11, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/072-inc3a-deptest

Conversation

@bartekus

@bartekus bartekus commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Spec 072 increment 3, step 1 (test only). Stacked on #588.

rustev-eval's tests/dependencies.rs (spec 004) pins its normal dependencies exactly. Increment 3 adds schemars (already a dependency of rustev-contract) in a dependency-only pull request, as the policy-isolation guard requires; that pull request cannot also change this test. So this change comes first: the test accepts either exact list, with or without schemars, and the schema change (step 3) tightens it to the list with schemars. Nothing else is admitted, and the target and build dependency checks are unchanged.

Order: this → the Cargo.toml/Cargo.lock change → the emitter, committed schemas and tests.

Local: cargo test -p rustev-eval --test dependencies passes; clippy and fmt clean; make gate passes; spec-spine couple reports no drift.

Review note (1a8163c): 620727a81636 is a false positive. The test parses the [dependencies] table of crates/rustev-eval/Cargo.toml in file order (include_str!("../Cargo.toml")), not Cargo.lock. The dependency-only commit appends schemars.workspace = true after serde_json, and this test passes against that commit (cargo test -p rustev-eval --test dependencies: 1 passed), as it does on this head.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at the two changed files:

specs/072-documentation-source-gaps/spec.md — adds a progress note describing the test change and explicitly stating no spec 004 claims are altered. This is a benign increment note in a draft spec; no governance issue.

crates/rustev-eval/tests/dependencies.rs — the transitional logic accepts either the existing exact list or a list that includes schemars. The stated purpose is to let the dependency-only PR add schemars without breaking the test before the schema-generating code lands.

The concrete defect: the with array places schemars after serde_json:

let with = [
    "rustev-contract",
    "rustev-core",
    "serde",
    "serde_json",
    "schemars",   // last
];

Alphabetically, schemars (sch…) sorts before serde (se…). The existing without list and the original assert_eq! both reflect the order of entries as they appear in the Cargo.toml, not post-sort. When the follow-on PR adds schemars to Cargo.toml in alphabetical order (the common convention), the parsed deps list will contain it before serde, not after serde_json. That means:

  • deps == without → false (schemars is now present)
  • deps == with → false (wrong position)
  • assert! panics: "unexpected rustev-eval dependencies"

The transitional test fails precisely when it is supposed to pass, defeating its stated purpose. The fix is to put schemars in its alphabetical position inside with (between rustev-core and serde), or to make the comparison order-independent.

{"head": "72dabab492d0087440632270359fa0cdcd1f2580", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/tests/dependencies.rs", "line": 26, "severity": "medium", "category": "correctness", "summary": "The 'with' array places 'schemars' after 'serde_json', but alphabetically 'schemars' precedes 'serde'; if the follow-on PR adds the dependency in sorted order the parsed list will not match either array, causing the transitional assertion to panic instead of passing."}]}

Subject: 4e575a1...72dabab, diff digest 889060ae013e9ca24815c4e1f0b2ba6f3be3b3b2aa7c18ddc5e684d36bf80834, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 10, 2026 22:44 — with GitHub Actions Error
Base automatically changed from spec/072-documentation-source-gaps to main November 10, 2026 23:34
Test only. The test accepts either exact dependency list, with or without
schemars, so the dependency-only change can pass on its own; the schema
change tightens it again.
@bartekus
bartekus force-pushed the impl/072-inc3a-deptest branch from 72dabab to 1a8163c Compare November 10, 2026 23:35
@bartekus
bartekus enabled auto-merge November 10, 2026 23:35
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the two changed files.

specs/072-documentation-source-gaps/spec.md — The addition is a plain progress note for increment 3, step 1. It correctly states this is test-only and makes no claim of spec 004 changes. No issues.

crates/rustev-eval/tests/dependencies.rs — The logic relaxes the strict equality check to accept either the old dependency list or the new one (with schemars). The intent is sound: allow a dependency-only PR to land before the schema-emitting PR, then tighten again.

One concrete defect: the with array places schemars after serde_json:

let with = [
    "rustev-contract",
    "rustev-core",
    "serde",
    "serde_json",
    "schemars",   // ← assumed last
];

Cargo.lock entries are sorted alphabetically. Alphabetically, schemars (prefix sch) precedes serde (prefix ser). If the test reads from a Cargo.lock-derived source (consistent with how the existing passing list ["rustev-contract", "rustev-core", "serde", "serde_json"] is built), then when schemars is added the actual deps will be ["rustev-contract", "rustev-core", "schemars", "serde", "serde_json"]. That matches neither without nor with, so both sides of the || are false, the assertion fires, and the dependency-only PR fails — the exact opposite of this change's stated goal.

The correct with array should put schemars before serde:

let with = [
    "rustev-contract",
    "rustev-core",
    "schemars",
    "serde",
    "serde_json",
];
{"head": "1a8163c9cc6cf1459271804e09dcc6006031ccf5", "verdict": "findings", "findings": [{"path": "crates/rustev-eval/tests/dependencies.rs", "line": 24, "severity": "medium", "category": "correctness", "summary": "The `with` array places `schemars` after `serde_json`, but Cargo.lock entries are alphabetically sorted, so `schemars` (sch < ser) would appear before `serde`, causing `deps == with` to be false when schemars is actually added and defeating the transitional test's stated purpose."}]}

Subject: 589185f...1a8163c, diff digest 889060ae013e9ca24815c4e1f0b2ba6f3be3b3b2aa7c18ddc5e684d36bf80834, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 10, 2026 23:37 — with GitHub Actions Inactive
@bartekus
bartekus temporarily deployed to statecraft-review-exception November 10, 2026 23:40 — with GitHub Actions Inactive
@bartekus
bartekus added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 694866c Nov 11, 2026
48 of 51 checks passed
@bartekus
bartekus deleted the impl/072-inc3a-deptest branch November 11, 2026 00:26

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 1a8163c9 Deployed Nov 10, 2026 by bartekus via review-exception #3971
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