VibeVM

org.vibevm.ai-native · rust · typescript · go

Code that AI agents actually understand.

Every line of code carries intent — and that intent is machine-traceable. The AI-Native Code Discipline is a set of rules and runnable gates for Rust, TypeScript, and Go: code written the way agents will maintain it — easily, safely, cheaply — not the way humans find it comfortable to read. The code itself stays ordinary idiomatic code under the ordinary compiler; the added strictness lives around it, machine-checkable: cells and seams, spec-to-code traceability, deviation testimony, deterministic conformance. Built for the codebase whose next maintainer is often a weaker model than the author.

The essayThe Big Vision →The worldview behind this discipline: two sources of intention, an expensive probabilistic layer over a cheap deterministic one — and traceable edges between them.

The problem

Green build, unreadable change

Your toolchain proves compilation, types, and style. It does not prove what a safe change actually depends on: which module a requirement lives in, where the seams are, whether that comment is still true, which contract an error just broke, what a given diff was allowed to touch. Frontier models already generate good code; the unsolved part is the rest of the lifecycle — a different, often weaker model reading and changing that code later. Humans re-derive the missing architecture on every review. Agents guess it.

  • The crate compiles and clippy is silent — and the reviewer still cannot tell which invariants the diff endangered.
  • The architecture lives in a document that stopped being true two refactors ago, and nothing ever compares it to the code.
  • The error says what failed, never which contract it violated — so every debugging session starts from zero.

The central law

Keep the code surface inside the training distribution. Put the strictness into the type system, the contracts, the metadata, and the verification loop — around the code, not in its syntax.

Models collapse on out-of-distribution surface syntax, and they recover through verification loops and executable helpers — the two dated, third-party results the discipline is built on and cites in its manifesto. So AI-Native Rust is not a dialect: at the token level it reads as ordinary idiomatic Rust, and the same holds for TypeScript and Go. What changes is the envelope — and every rule in it ships a checker, because a rule a model must remember decays, while a rule a machine enforces holds.

The manifesto tags each of its own claims [E-strong], [E-mid], or [E-hyp] — benchmark-backed, adjacent evidence, or hypothesis the pilot must validate. A discipline that names its failure modes is more trustworthy than one that hides them.

Spec-driven, honestly

“True” Spec-Driven Development — where every change regenerates the whole codebase from the specification — is an unreachable dream: nobody has that much money. This discipline works the other way around. The specification sets the contract; the code is its technical realization — and for the low-level detail, there is no better contract than the code itself. That is why spec and code are joined by traceable, checkable edges, not by regeneration.

Architecture

One neutral core, projected per language

The language-independent core ships the manifesto, the pattern-card format, the nine-class catalog of executable scaffolds, the operating playbooks, and the neutral engines: conformance, traceability, the inert tag macro. Each language stack projects that core through its own fact extractor and four gate binaries, adds a generation-time type oracle, the language guide, the nine cards in language shape, and two agent skills. Your project keeps the policy — which cells are gated, which are exempt and why. The packages ship engines, never policy.

Each stack also ships as an MCP server (*-ai-native-mcp) — the same command surface plus the type oracle for any MCP-capable agent; the Rust server alone exposes eighteen tools. Distribution is vibe: one aggregator package per language pins stack, server, and core to one resolved version set.

The dividing line

What your toolchain proves — and what the gate adds

The discipline deletes nothing. Each language’s floor runs your existing tools first, in a fixed order, then appends three gates of its own: conform for structure, specmap for traceability, test-gate for the baseline. One command, one exit code.

Rust

already yours

  1. fmt
  2. test
  3. clippy
  4. conform
  5. specmap
  6. test-gate

the gate adds

  • Cell isolation: cells import seams and the core, never sibling cells.
  • No unwrap in domain logic — a panic path needs an error contract or recorded deviation.
  • Error enums cite the requirement they enforce, in the error text itself.
  • File budget, and invariants may not drown in a file’s middle third.

TypeScript

already yours

  1. prettier
  2. tsc
  3. tests
  4. eslint
  5. conform
  6. specmap
  7. test-gate

the gate adds

  • The unsafe-set census: as, any, non-null !, @ts-ignore become findings unless carried by a recorded deviation.
  • Cell isolation over import specifiers.
  • Environment reads are legal only in the composition root.
  • Seam error types cite their spec:// requirement.

Go

already yours

  1. gofmt
  2. vet
  3. tests
  4. staticcheck + exhaustive
  5. conform
  6. specmap
  7. test-gate

the gate adds

  • Cell isolation at package grain, plus the ban census with deviation testimony.
  • //spec: directives feed a committed index with a package-grain orphan ratchet.
  • Closed-set switches ride exhaustive — Go has no sum types, so the gate leans on the ecosystem’s carrier.
  • test-gate runs xfail-strict over go test -json.

Mechanisms

Five things you can hold in your hands

  1. Traceability that survives refactors

    Code carries inert tags — at most three edges per item, typed implements | verifies | documents | deviates | informs. The specmap engine compiles them into a committed, deterministic index: spec units on one side, code items on the other. Invalidation is asymmetric by design: bump a spec unit’s revision and its edges turn suspect; edit the code and the edges hold. An item that loses its anchor is an orphan the ratchet refuses to accept. That is the difference between architecture you re-derive and architecture you query.

    before
    #[derive(Debug, Error)]
    pub enum Error {
        #[error("invalid package reference `{input}`")]
        InvalidRef { input: String },
    }
    under the discipline
    #[derive(Debug, Error)]
    #[spec(implements = "spec://…#package-identity")]
    pub enum Error {
        #[error(
            "invalid package reference `{input}`: \
             {reason} \
             (violates spec://…#pkgref; \
              fix: `[kind:][group/]name[@version]`)"
        )]
        InvalidRef { input: String, reason: String },
    }

    Abridged from the pilot’s own vibe-core. The failure now names the contract it broke and the fix surface — for the reviewer and for the next agent alike; the error-enum-cites-req gate keeps it that way.

    The same edge, in each language:

    #[spec(implements = "spec://…#anchor")]
    /** @implements spec://…#anchor */
    //spec:implements spec://…#anchor r=1
  2. The floor: one command, one exit code

    rust-ai-native floor, typescript-ai-native floor, go-ai-native floor. Formatters, compilers, linters, and tests run first; the discipline’s gates run after, in the same panel. Every policy line prints its origin, and a Defaulted policy announces itself — never trust a green you didn’t configure. Conformance is deterministic: same inputs, byte-identical SARIF, no model anywhere in the checking path.

  3. The ratchet, or how a real repo adopts this

    init writes the pre-adoption posture: every crate or cell exempt, each with a recorded reason; the only hard precondition is that the workspace compiles. From there the direction is one-way — drain a unit to zero findings, flip it into the gated list, and a flip must never widen the baseline. Pre-existing findings freeze in conform-baseline.json; new ones fail the gate; the baseline only shrinks. The test gate is xfail-strict: it fails on a new failure and on an unexpected pass nobody promoted, so the baseline shrinks truthfully.

    {
      "findings": [],
      "schema": 1
    }
    vibevm’s own conform-baseline.json today, in full: every gated crate entered at zero findings.
  4. Bans carry escape hatches

    Forbidden-by-default constructs stay legal with machinery and a recorded reason. A matching deviation downgrades the finding to deviation-acknowledged — visible, counted, reviewable — instead of silencing it. The discipline states its own symmetry: a ban with no escape hatch is a bug in the discipline; a deviation with no reason is a bug in the code.

    #[spec(deviates, reason = "platform ctor runs single-threaded, pre-main")]
    A real deviation shape from the pilot: the reason travels with the code, and the gate reads it.
  5. A type oracle at generation time

    Before writing a nontrivial edit, an agent can validate the hypothetical file content — unsaved, over in-memory overlays — against the language’s own analyzer: rust-analyzer, your project’s typescript, gopls. The oracle merges the gate’s conform rules into its answers (validate / scope / complete / type), so a discipline violation surfaces before the diff exists. The honesty is in the brief: an analyzer is not the compiler; a clean validate shortens the distance to green — the floor stays the truth.

    vibe bin exec rust-ai-native-tcg -- validate src/cells/edit.rs --content-from -
    Also served over MCP as tcg_validate / tcg_scope / tcg_complete / tcg_type.

The family

Three projections, one bar

Parity is a law of the discipline, not a hope: no language projection may enforce the discipline more weakly than another without a recorded reason. Where a language genuinely lacks an idiom’s analogue, the gap is recorded — with the reason as the escape hatch, never in silence.

the pilot

AI-Native Rust

The borrow checker is already a verifier, so the projection leans on it: typestate and newtypes at seams, panic-free domain logic, compiled doctests per public seam. Furthest along — the reference bar the other projections are measured against.

second projection

AI-Native TypeScript

TypeScript adds a hazard Rust does not have: a type system you can defeat in two words. So the gate takes the escape hatches themselves under census — as, any, !, @ts-ignore — and untyped data enters as unknown, narrowed by runtime validators at the erasure boundary. In exchange: the most mature codemod and Compiler-API tooling of any mainstream language.

third, newest

AI-Native Go

No sum types, so closed-set exhaustiveness rides the ecosystem’s own carrier beside gofmt, vet, and staticcheck. The fact extractor is pure Go stdlib — the only external process on the critical path is the language’s official tooling. Worked pilot: a miniature reconciler with the whole chain green.

Beyond these three: C++ and Python exist in the engine spec as rows explicitly marked «specified, not built». They become stacks when a product decision says so — not silently.

Dogfood

Piloted on the code that ships it

The discipline is a product in its own right, and VibeVM is its first pilot — not its scope boundary. The vibe CLI, a Rust workspace of a few dozen crates, runs the gates on itself: most crates gated, the rest exempt with recorded reasons, and the ratchet baseline is empty today. Its committed traceability index carries thousands of spec units and edges. In the same family, Zap’s Rust engine and its TypeScript client run the same gates — the client alone gates dozens of cells across a six-figure line count. The lock file pins the exact discipline version the pilot runs, and the adoption campaign’s paper trail — baseline, log, report — is in the tree.

  • The sweep idioms in the Rust guide — tests-out splits, restructure-beats-testify, flip-only-after-drain — are distilled from the pilot’s own campaigns, each with its gotchas recorded.
  • The spec corpus audits itself: claims that outran the code are annotated «specified, not built» in place, down to file and line. The traceability machinery is what makes that check possible at all.
  • What we do not claim: no performance numbers, no adoption statistics, no measured productivity delta. The discipline’s evidence base is cited and tagged in the manifesto; its own pilot metrics are still ahead.

Status, plainly

A research beta that names its failure modes

Verified today

  • The neutral engines, the three language stacks, and the MCP servers ship and run.
  • The gates hold on three real codebases — the vibe CLI, Zap’s engine, Zap’s client.
  • Worked demo projects for all three languages sit in the pilot’s tree; the Go demo documents its whole chain green.
  • The brownfield registries — debt with sunsets, xfail-strict test baselines, intent with a carry-over guarantee — are in use on the pilot.

Being explored

  • Transfer is the central open question: the executable-scaffold evidence is about generation; whether the advantage carries to modification is exactly what the pilot must falsify.
  • Card delivery is a boot instruction a session follows — not yet a computed activation match.
  • Deeper semantic rules wait, by recorded ruling, for the second type-requiring check.

Not promised

  • Stability. This is a beta: rules, names, and the set of checks will change.
  • Languages beyond Rust, TypeScript, and Go.
  • Benchmarks of our own — every card carries a falsifiable prediction in place of a measurement, and reading the maturity tags is part of using the discipline.

The invitation is to try the discipline, read its manifesto, and argue with it — not to believe a stability promise.

Start

Adopt it the way the protocol says: gradually

  1. $vibe install org.vibevm.ai-native/rust-ai-native

    One aggregator per language — typescript-ai-native and go-ai-native are its siblings — pins the stack, its MCP server, and the neutral core to one resolved version set. Need vibe first? Install VibeVM →

  2. $rust-ai-native init

    Writes the pre-adoption posture into your repo: conform.toml with every crate exempt-with-a-reason, specmap.toml with external spec resolution, the debt and intent registries. Nothing gates yet — and every tool is already useful at 0% adoption.

  3. $rust-ai-native floor

    Your existing tools first, the discipline’s gates after, one exit code. Green means: no regression against the inventory — the honest definition for a repository that is mid-flight.

  4. Drain one cell, flip it

    Pick one crate or cell, drain its findings to zero, flip it into the gated list — the baseline only shrinks. The terraform and sweep skills carry the procedures as your agents’ slash commands.

In one paragraph

AI-Native Rust, TypeScript, and Go are one engineering discipline projected onto ordinary languages: the code stays idiomatic and in-distribution, while cells, contracts, spec-to-code traceability, and deviation testimony live in a machine-checked envelope — enforced by deterministic gates beside your formatter, compiler, and linter, and adopted crate by crate under a ratchet that only shrinks. Research beta, piloted on VibeVM itself: vibe install org.vibevm.ai-native/rust-ai-native.