Skip to content

impl(011): increment 2, the boundary check extension - #442

Merged
bartekus merged 1 commit into
mainfrom
impl/011-boundaries
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/011-boundaries

Conversation

@bartekus

@bartekus bartekus commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Spec 011, increment 2: the boundary check extension (3.18), adding rule 3.4.6 to spec 001's checker.

  • tools/rustev-boundaries/src/lib.rs gains the local inference runtime family, matched by package name (ort, ort-sys, onnxruntime, onnxruntime-sys, tokenizers, tract-*, candle-*, tch, torch-sys), and hf-hub as a model hub client.
  • (a) The family is refused in the normal and build graphs of rustev-contract and rustev-core (001 3.4.1's message).
  • (b) Only backends/rustev-backend-embed-linear/ may depend on a family member; any other workspace crate reaching one, including through a helper, is refused, and a dependency on the backend crate without optional = true is refused (001 3.4.6).
  • (c) hf-hub and ort's download-binaries, copy-dylibs and fetch-models features, declared or resolved, are refused everywhere, the backend included.
  • No workspace crate depends on the family yet; the workspace run reports no violation.

Spec: a dated increment 2 paragraph in 011's implementation record.

Verification

  • cargo test -p rustev-boundaries --locked (47 tests; 8 new: local_inference_family_matches_exact_names_and_prefixes, local_inference_is_forbidden_in_contract_and_core_graphs, local_inference_direct_edges_require_the_backend_directory, local_inference_cannot_bypass_backend_through_a_helper, node_optional_local_backend_passes_but_required_dependency_fails, hf_hub_is_forbidden_even_in_the_backend_or_external_packages, every_ort_download_feature_is_forbidden_declared_or_resolved, direct_local_inference_purity_violation_needs_no_confirmation), clippy -D warnings, cargo fmt --all --check, cargo run -p rustev-boundaries, make gate, scripts/check-authored-content.sh.

rustev-boundaries refuses the local inference runtime family outside the
embed-linear backend, in the contract and core graphs, and refuses hf-hub
and ort's download features everywhere (011 3.18, 001 3.4.6).
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

AI review (findings)

Looking at the two changed files, I'll examine the boundary-check logic and spec updates for concrete defects.


Spec (specs/011-semantic-backend/spec.md) — the prose increment is internally consistent with the code added in lib.rs; no defect there.

Code (tools/rustev-boundaries/src/lib.rs)

Finding — own_graph_of guard breaks confirmation for resolve-section ForbiddenTransitive violations on direct-dep paths

The original own_graph_of:

Violation::ForbiddenTransitive { krate, .. } => Some((krate.as_str(), "all")),

is replaced with:

Violation::ForbiddenTransitive { krate, path } if path.len() > 2 => Some((krate.as_str(), "all")),

The intent is clear: the new dep-loop insertions (for direct non-dev local-inference deps on pure crates, lines ~462–470) produce path.len() == 2 and should auto-confirm because the dep-loop already excluded dev deps via dep.kind.as_deref() != Some("dev"). The guard makes own_graph_of return None for those, which is correct for that source.

However, the new resolve-section block (lines ~607–619) also calls forbidden_path(&graph, …, is_local_inference) for rustev-contract/rustev-core and inserts ForbiddenTransitive with the returned path. For a direct dep, forbidden_path returns a path of length exactly 2. Because the resolve-section code applies no dev-dep filter (unlike the dep-loop check), a direct dev dep from a pure crate to a local-inference package would produce path.len() == 2, now auto-confirmed by own_graph_of returning None. The own-graph confirmation step that previously filtered out dev-dep-only paths is bypassed.

The direct_local_inference_purity_violation_needs_no_confirmation test only exercises a Some("build") dep-loop case, not a dev dep found via forbidden_path. No test in the diff covers a pure crate with a direct dev dep on a local-inference package, leaving this scenario untested and potentially producing a false-positive confirmed ForbiddenTransitive violation.


{"head": "5faed62a3a764391a419fc56c77f8c337c814de2", "verdict": "findings", "findings": [{"path": "tools/rustev-boundaries/src/lib.rs", "line": 659, "summary": "The `if path.len() > 2` guard in `own_graph_of` removes own-graph confirmation for all ForbiddenTransitive violations with a direct-dep path (length 2), including those produced by the new resolve-section `forbidden_path` call for pure crates; since that path has no dev-dep filter (unlike the dep-loop check at line ~462), a direct dev dep from rustev-contract or rustev-core to a local-inference package would produce a length-2 path that auto-confirms as a false positive."}]}

Subject: 5d67df0...5faed62, diff digest ac52c8e2608bd152593ce95dfee31ca9bcce174f9dee680453e4425b4b711420, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 1, 2026 06:35 — with GitHub Actions Failure
@bartekus
bartekus enabled auto-merge November 2, 2026 00:20
@bartekus
bartekus temporarily deployed to statecraft-review-exception November 2, 2026 00:21 — with GitHub Actions Inactive
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit a49e40f Nov 2, 2026
58 of 60 checks passed
@bartekus
bartekus deleted the impl/011-boundaries branch November 2, 2026 02:34

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 5faed62a Deployed Nov 2, 2026 by bartekus via review-exception #2962
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