{"id":47115447,"url":"https://github.com/pulseengine/rules_verus","last_synced_at":"2026-03-12T18:58:26.904Z","repository":{"id":339529830,"uuid":"1162313911","full_name":"pulseengine/rules_verus","owner":"pulseengine","description":"Bazel rules for Verus SMT-backed Rust verification","archived":false,"fork":false,"pushed_at":"2026-03-01T08:33:58.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-01T10:53:31.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pulseengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T05:28:12.000Z","updated_at":"2026-03-01T08:34:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pulseengine/rules_verus","commit_stats":null,"previous_names":["pulseengine/rules_verus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pulseengine/rules_verus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_verus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_verus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_verus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_verus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulseengine","download_url":"https://codeload.github.com/pulseengine/rules_verus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_verus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-12T18:58:26.252Z","updated_at":"2026-03-12T18:58:26.898Z","avatar_url":"https://github.com/pulseengine.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# rules_verus\n\n\u003csup\u003eBazel rules for Verus Rust verification\u003c/sup\u003e\n\n\u0026nbsp;\n\n![Bazel](https://img.shields.io/badge/Bazel-43A047?style=flat-square\u0026logo=bazel\u0026logoColor=white\u0026labelColor=1a1b27)\n![Formally Verified](https://img.shields.io/badge/Formally_Verified-00C853?style=flat-square\u0026logoColor=white\u0026labelColor=1a1b27)\n![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue?style=flat-square\u0026labelColor=1a1b27)\n\n\u003c/div\u003e\n\n\u0026nbsp;\n\nBazel rules for [Verus](https://github.com/verus-lang/verus) SMT-backed Rust verification. Downloads pre-built Verus release binaries from GitHub with hermetic toolchain support.\n\n\u003e [!NOTE]\n\u003e Part of the PulseEngine toolchain. Provides Verus verification infrastructure used across PulseEngine for Rust correctness proofs.\n\n## Quick Start\n\n### 1. Add to MODULE.bazel\n\n```starlark\nbazel_dep(name = \"rules_verus\", version = \"0.1.0\")\n\ngit_override(\n    module_name = \"rules_verus\",\n    remote = \"https://github.com/pulseengine/rules_verus.git\",\n    commit = \"\u003clatest-commit\u003e\",\n)\n\n# Configure Verus toolchain\nverus = use_extension(\"@rules_verus//verus:extensions.bzl\", \"verus\")\nverus.toolchain(version = \"0.2026.02.15\")\nuse_repo(verus, \"verus_toolchains\")\nregister_toolchains(\"@verus_toolchains//:all\")\n```\n\n### 2. Create a Rust file to verify\n\n```rust\n// counter.rs\nuse vstd::prelude::*;\n\nverus! {\n\npub struct Counter {\n    pub value: u64,\n}\n\nimpl Counter {\n    pub spec fn valid(\u0026self) -\u003e bool {\n        self.value \u003c u64::MAX\n    }\n\n    pub fn increment(\u0026mut self)\n        requires old(self).valid(),\n        ensures self.value == old(self).value + 1,\n    {\n        self.value = self.value + 1;\n    }\n}\n\n} // verus!\n```\n\n### 3. Add BUILD.bazel\n\n```starlark\nload(\"@rules_verus//verus:defs.bzl\", \"verus_library\", \"verus_test\")\n\nverus_library(\n    name = \"counter_verified\",\n    srcs = [\"counter.rs\"],\n)\n\nverus_test(\n    name = \"counter_test\",\n    srcs = [\"counter.rs\"],\n)\n```\n\n### 4. Build and verify\n\n```bash\n# Verify (produces stamp file on success)\nbazel build //:counter_verified\n\n# Run as test\nbazel test //:counter_test\n```\n\n## Multi-File Crates\n\nFor crates with multiple source files, list all files in `srcs` and optionally specify a `crate_root`:\n\n```starlark\nverus_library(\n    name = \"my_proofs\",\n    srcs = [\n        \"src/lib.rs\",\n        \"src/vec_proofs.rs\",\n        \"src/map_proofs.rs\",\n    ],\n    crate_root = \"src/lib.rs\",   # Optional: defaults to lib.rs in srcs, or srcs[0]\n    crate_name = \"my_proofs\",    # Optional: defaults to target name\n)\n```\n\nThe `crate_root` file should contain `mod` declarations for the other source files:\n\n```rust\n// src/lib.rs\nmod vec_proofs;\nmod map_proofs;\n```\n\n## Cross-Crate Dependencies\n\nUse `deps` to express verification dependencies between crates. Downstream targets automatically wait for upstream verification to complete.\n\n```starlark\n# Base verified library\nverus_library(\n    name = \"foundation_proofs\",\n    srcs = [\"foundation.rs\"],\n)\n\n# Depends on foundation_proofs verification\nverus_library(\n    name = \"runtime_proofs\",\n    srcs = [\"runtime.rs\"],\n    deps = [\":foundation_proofs\"],\n)\n\n# Test that depends on both\nverus_test(\n    name = \"integration_test\",\n    srcs = [\"integration.rs\"],\n    deps = [\n        \":foundation_proofs\",\n        \":runtime_proofs\",\n    ],\n)\n```\n\nWhen `deps` are specified, the rule passes `--extern {crate_name}={stamp_path}` to Verus for each dependency, enabling cross-crate verification.\n\n## API Reference\n\n### verus_library\n\nVerifies Rust source files with Verus. Produces a stamp file on success.\n\n| Attribute | Type | Description |\n|-----------|------|-------------|\n| `srcs` | `label_list` | Rust source files to verify (`.rs`). **Required.** |\n| `crate_root` | `label` | Explicit crate root file. If not set, uses `lib.rs` from srcs or `srcs[0]`. |\n| `crate_name` | `string` | Crate name for `--crate-name` flag. Defaults to target name with hyphens as underscores. |\n| `deps` | `label_list` | Other `verus_library` targets this depends on for `--extern` resolution. |\n| `extra_flags` | `string_list` | Extra flags to pass to Verus (e.g., `[\"--multiple-errors\", \"5\"]`). |\n\n### verus_test\n\nTest target that runs Verus verification. Passes if all proofs verify.\n\n| Attribute | Type | Description |\n|-----------|------|-------------|\n| `srcs` | `label_list` | Rust source files to verify (`.rs`). **Required.** |\n| `crate_root` | `label` | Explicit crate root file. If not set, uses `lib.rs` from srcs or `srcs[0]`. |\n| `crate_name` | `string` | Crate name for `--crate-name` flag. Defaults to target name with hyphens as underscores. |\n| `deps` | `label_list` | Other `verus_library` targets this depends on for `--extern` resolution. |\n| `extra_flags` | `string_list` | Extra flags to pass to Verus. |\n\n## Kiln Integration Example\n\nVerifying Kiln's safety-critical `StaticVec` bounded collection:\n\n```starlark\nverus_library(\n    name = \"kiln_static_vec_proofs\",\n    srcs = [\n        \"kiln-foundation/src/verus_proofs/mod.rs\",\n        \"kiln-foundation/src/verus_proofs/static_vec_proofs.rs\",\n    ],\n    crate_root = \"kiln-foundation/src/verus_proofs/mod.rs\",\n    crate_name = \"kiln_static_vec_proofs\",\n)\n\nverus_test(\n    name = \"kiln_static_vec_verify\",\n    srcs = [\n        \"kiln-foundation/src/verus_proofs/mod.rs\",\n        \"kiln-foundation/src/verus_proofs/static_vec_proofs.rs\",\n    ],\n    crate_root = \"kiln-foundation/src/verus_proofs/mod.rs\",\n    crate_name = \"kiln_static_vec_proofs\",\n)\n```\n\n## Supported Platforms\n\n| Platform | Status |\n|----------|--------|\n| macOS x86_64 | Supported |\n| macOS aarch64 | Supported |\n| Linux x86_64 | Supported |\n| Windows x86_64 | Supported |\n\n## How It Works\n\n1. The module extension downloads pre-built Verus binaries from GitHub releases\n2. The toolchain provides the Verus binary, Z3 SMT solver, and vstd standard library\n3. `verus_library` runs Verus verification and produces a stamp file on success\n4. `verus_test` wraps verification as a Bazel test target for CI integration\n5. Cross-crate `deps` ensure verification ordering via stamp file dependencies\n\n## License\n\nApache-2.0\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003csub\u003ePart of \u003ca href=\"https://github.com/pulseengine\"\u003ePulseEngine\u003c/a\u003e \u0026mdash; formally verified WebAssembly toolchain for safety-critical systems\u003c/sub\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_verus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseengine%2Frules_verus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_verus/lists"}