Skip to content

Commit f1b9e60

Browse files
authored
docs: check-rust onboarding discoverability + CotW draft (#1467)
## Summary MPI session batch (gate + End User / QA / Product perspectives). - Surface `demos/check-rust` from `demos/README`, GETTING-STARTED, root README - Add `inc_mut.rs` linear `let mut` demo; raise `check_rust_demos` floor to 4 - CotW nomination draft: `docs/launch/crate-of-the-week.md` - Filed **#1466** for CFG SSA residual (mut inside if/match) ### Gate notes | Issue | Status | |-------|--------| | #1410 #1411 | Human outreach (partially done); not agent-closable | | #436 | Blocked on upstream cvc5-rs | | #1396 | Still wait metrics/discussion for big lists | ## Test plan - [x] `cargo test -p assura --test check_rust_demos --locked` - [x] `bash scripts/check-rust-demos.sh` - [x] `assura check-rust demos/check-rust/ok` → 4 verified Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 33c3904 commit f1b9e60

8 files changed

Lines changed: 55 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ assura check-rust src/
181181
# 1) co-located {Name}.ir
182182
# 2) encoded Rust body (arith/if/match/wrapping/bitops/…; see docs/CHECK-RUST-SURFACE.md)
183183
# Otherwise ensures are body_not_modeled (not silent verified/skipped).
184-
# User map: docs/CHECK-RUST-SURFACE.md | contributor detail: CONTRIBUTING "check-rust body proof"
184+
# User map: docs/CHECK-RUST-SURFACE.md | demos: demos/check-rust/ | interop: examples/interop-rust/
185185
assura check-rust src/ --json
186+
assura check-rust demos/check-rust/ok # prove demos (expect exit 0)
186187

187188
# Suggest contracts for unannotated functions
188189
assura check-rust src/ --suggest

crates/assura-cli/tests/check_rust_demos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn check_rust_demos_ok_tree_proves() {
2020
);
2121
let v: serde_json::Value = serde_json::from_str(&stdout).expect("json");
2222
assert_eq!(v["body_not_modeled"], 0, "{stdout}");
23-
assert!(v["verified"].as_u64().unwrap_or(0) >= 3, "{stdout}");
23+
assert!(v["verified"].as_u64().unwrap_or(0) >= 4, "{stdout}");
2424
assert_eq!(v["errors"], 0, "{stdout}");
2525
}
2626

demos/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ assura check demos/heartbleed.assura
3131

3232
# Result-bearing ensures: many shapes synthesize in memory (no hand IR).
3333
assura check demos/showcase-echo.assura
34+
35+
# Inline Rust annotations (/// @ensures), not .assura files:
36+
assura check-rust demos/check-rust/ok
37+
# Intentional counterexample (expect non-zero exit):
38+
assura check-rust demos/check-rust/fail/clamp_wrong.rs
3439
```
3540

41+
Full map: [check-rust/README.md](check-rust/README.md) and
42+
[docs/CHECK-RUST-SURFACE.md](../docs/CHECK-RUST-SURFACE.md). Interop sample
43+
crate: [examples/interop-rust](../examples/interop-rust).
44+
3645
Do **not** start with `demos/*-audit.assura` or `defi-audit.assura` unless you
3746
are studying expected failures.
3847

demos/check-rust/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ assura check-rust demos/check-rust/ok
1111
assura check-rust demos/check-rust/ok/clamp.rs
1212
assura check-rust demos/check-rust/ok/inc.rs
1313
assura check-rust demos/check-rust/ok/abs.rs
14+
assura check-rust demos/check-rust/ok/inc_mut.rs
1415
```
1516

1617
| File | Point |
1718
|------|--------|
1819
| `ok/clamp.rs` | if/else + `result >= 0` |
1920
| `ok/inc.rs` | pure `let` + `result == x + 1` |
2021
| `ok/abs.rs` | `x.abs()` method body |
22+
| `ok/inc_mut.rs` | linear `let mut` + `+=` |
2123

2224
## Fail intentionally (expect exit non-zero)
2325

demos/check-rust/ok/inc_mut.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Demo: straight-line let mut + += (linear SSA fold).
2+
// Run: assura check-rust demos/check-rust/ok/inc_mut.rs
3+
4+
/// @ensures result == x + 1
5+
pub fn inc_mut(x: i64) -> i64 {
6+
let mut y = x;
7+
y += 1;
8+
y
9+
}

docs/GETTING-STARTED.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ For broader language coverage, see [TUTORIAL.md](TUTORIAL.md) and
1414

1515
After your first successful check, read [What we prove](WHAT-WE-PROVE.md)
1616
so Verified / Unknown / Counterexample (and vacuous success) are not
17-
confused. AI-oriented workflow: [AI-AGENTS.md](AI-AGENTS.md).
17+
confused. AI-oriented workflow: [AI-AGENTS.md](AI-AGENTS.md) and
18+
[AGENT-LOOP.md](AGENT-LOOP.md).
19+
20+
**Existing Rust with doc-comment contracts:** see
21+
[CHECK-RUST-SURFACE.md](CHECK-RUST-SURFACE.md) and try:
22+
23+
```bash
24+
assura check-rust demos/check-rust/ok
25+
```
1826

1927
## 1. Install
2028

docs/launch/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Only after: polished gallery (GIF), maker bio, docs URL not confused with assura
8989
| [../COMPARE.md](../COMPARE.md) | Assura vs Verus / Dafny (includes check-rust) |
9090
| [../CHECK-RUST-SURFACE.md](../CHECK-RUST-SURFACE.md) | What check-rust can prove on Rust |
9191
| [../AGENT-LOOP.md](../AGENT-LOOP.md) | Agent JSON branch policy |
92+
| [crate-of-the-week.md](crate-of-the-week.md) | TWiR CotW nomination draft (next outreach) |
9293

9394
## Pre-post checklist
9495

docs/launch/crate-of-the-week.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This Week in Rust — Crate of the Week nomination (draft)
2+
3+
Post as a reply on:
4+
https://users.rust-lang.org/t/crate-of-the-week/2704
5+
6+
Disclosure: I maintain Assura.
7+
8+
```
9+
I'd like to nominate **assura** (https://crates.io/crates/assura):
10+
11+
Contract-first verification language that uses Z3/CVC5 and emits Rust.
12+
Also `assura check-rust` for /// @requires / @ensures on existing Rust
13+
(modeled body surface; fail closed on body_not_modeled). Aimed at AI
14+
implement loops with structured Verified / Counterexample / Unknown.
15+
16+
Docs: https://assura-lang.github.io/assura/
17+
Compare (vs Verus/Dafny): https://assura-lang.github.io/assura/COMPARE.html
18+
```
19+
20+
Do not open a full TWiR Projects/Tooling PR with only a repo link (they
21+
reject bare crate dumps). Prefer this CotW nomination and/or a long-form
22+
post first.

0 commit comments

Comments
 (0)