-
Notifications
You must be signed in to change notification settings - Fork 2
engine: advisory venue-agnostic acyclicity check #432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9de6119
ci: add the advisory venue-agnostic check for nexum-runtime
mfw78 cc80329
ci: fail the crate-graph check when cargo tree errors
mfw78 370dec1
ci: fail the scan steps when rg errors instead of finding nothing
mfw78 f0a5564
ci: scan crate graph with --all-features so feature-gated venue deps …
mfw78 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/usr/bin/env bash | ||
| # Venue-agnosticism check for nexum-runtime: the crate graph reaches no | ||
| # videre/intent/venue/cow crate, the sources carry no venue symbol, and | ||
| # nexum:host resolves as a leaf WIT package. Advisory in CI until the | ||
| # physical cut lands; run locally via `just check-venue-agnostic`. | ||
|
|
||
| set -uo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| cd "$SCRIPT_DIR/.." || exit 2 | ||
|
|
||
| pass() { printf '\033[1;32m[l1 PASS]\033[0m %s\n' "$*" >&2; } | ||
| fail() { printf '\033[1;31m[l1 FAIL]\033[0m %s\n' "$*" >&2; status=1; } | ||
|
|
||
| command -v rg >/dev/null || { echo "ripgrep (rg) is required" >&2; exit 2; } | ||
|
|
||
| status=0 | ||
|
|
||
| # 1. Crate graph: nothing venue-shaped reachable from nexum-runtime | ||
| # (normal + build edges; dev-deps stay local to the crate). | ||
| if tree="$(cargo tree -p nexum-runtime -e normal,build --all-features --prefix none --locked)"; then | ||
| reached="$(printf '%s\n' "$tree" | | ||
| awk '{print $1}' | sort -u | rg -i 'videre|intent|venue|cow' || true)" | ||
| if [[ -n $reached ]]; then | ||
| fail "crate graph reaches: $(tr '\n' ' ' <<<"$reached")" | ||
| else | ||
| pass "crate graph clean" | ||
| fi | ||
| else | ||
| fail "cargo tree failed" | ||
| fi | ||
|
|
||
| # 2. Symbol scan: no venue vocabulary anywhere in the crate. Word shapes | ||
| # skip std::borrow::Cow, ProviderError, and "intentional". | ||
| symbols='\b[Vv]idere|\b[Ii]ntent([_A-Z-]|s?\b)|\b[Vv]enue|\bcow|CoW|\bCow[A-Z]' | ||
|
mfw78 marked this conversation as resolved.
|
||
| rg -n --no-heading -e "$symbols" crates/nexum-runtime | ||
| case $? in | ||
| 0) fail "venue symbols leak into nexum-runtime" ;; | ||
| 1) pass "symbol scan empty" ;; | ||
| *) fail "symbol scan errored (crates/nexum-runtime missing?)" ;; | ||
| esac | ||
|
|
||
| # 3. WIT DAG: nexum:host is a leaf. No cross-package use/import, and the | ||
| # package resolves standalone. | ||
| rg -n --no-heading -e '^\s*(use|import)\s+[a-z0-9-]+:' wit/nexum-host | ||
| case $? in | ||
| 0) fail "nexum:host references another WIT package" ;; | ||
| 1) pass "nexum:host has no cross-package reference" ;; | ||
| *) fail "WIT scan errored (wit/nexum-host missing?)" ;; | ||
| esac | ||
| if command -v wasm-tools >/dev/null; then | ||
| if wasm-tools component wit wit/nexum-host >/dev/null; then | ||
| pass "nexum:host resolves standalone" | ||
| else | ||
| fail "nexum:host does not resolve standalone" | ||
| fi | ||
| else | ||
| printf '\033[1;33m[l1 WARN]\033[0m wasm-tools not found; WIT resolve skipped\n' >&2 | ||
| fi | ||
|
|
||
| exit "$status" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.