AI-Native Rust (Discipline v0.2) — boot snippet
01Rust code in this project follows the AI-Native Rust guide
(spec/rust/GUIDE-AI-NATIVE-RUST.xml in this package).
02Read the guide when authoring or reviewing structure; per-edit work needs only the card whose trigger fires.
03Card registry for Rust: spec/cards/INDEX.xml in this package (trigger → card;
the nine executable scaffolds A–I in their Rust shape).
04This stack ships
its own spec/cards/ projection — the weak-reader runtime surface for a .rs
edit is a Rust card's Band-3 ops block, never another language's.
05Standing rules at the surface level:
- 06Ordinary idiomatic Rust at the token level — no invented dialect.
Strictness lives in the envelope: newtypes/typestate at seams,
runnable contracts at use sites,
#[spec]metadata, per-cell fast verification (cargo test -p <cell>, < ~60s). - Cells: one cell = one file-set, single registration point; cells import seams + core only, never sibling cells. Ambient coupling is forbidden.
- One
thiserrorenum per layer; error messages cite the violatedspec://REQ and a fix surface.unwrap/expectin domain logic is forbidden by default — escape hatch is#[spec(deviates, reason)]with machinery. - Every public seam carries one compiled doctest of canonical use. Replacing a non-trivial cell requires a differential oracle.
- Uniformity is load-bearing: one idiom per operation; exceptions are marked, or they propagate as false training signal.
07The shipped toolchain (this stack materialises it; no dev tree needed):
- 08
rust-ai-native—init(bootstrap policies + registries),floor(fmt→test→clippy→conform→specmap→test-gate, one exit code),health(the sweep's fact collector),test-gate/tripwire/trace/fast-loop/codemod/ledger; - plus the narrow
rust-ai-native-conformandrust-ai-native-specmapengines, - and the agentic type oracle
rust-ai-native-tcg(also served over MCP bymcp:org.vibevm.ai-native/rust-ai-native-mcp— PROP-027) (persistent enrichingserverelay + one-shotvalidate/scope/complete/type/bench: check an edit against in-memory overlays BEFORE writing it, answered by the CONSUMER's own rust-analyzer with the SAME conform rules as the gate — GUIDE §12, §13 move 8; prerequisiterustup component add rust-analyzer; honesty: the oracle approximates, the floor stays the truth).
09Run vibe-natively
(vibe bin exec rust-ai-native -- <args> — PROP-025 lockfile
dispatch; vibe bin build pre-builds), from PATH (cargo install
--path vibedeps/<stack-slot>/crates/rust-ai-native-cli), or in place
via cargo run --manifest-path vibedeps/<stack-slot>/Cargo.toml -p
rust-ai-native-cli --bin rust-ai-native -- <args>.
10Wiring recipe: GUIDE §13; sweep idioms: GUIDE §14.
11Procedures as agent skills:
/rust-ai-native-sweep (recurring), /rust-ai-native-terraform (brownfield
adoption) — vibe skill install projects them.