graft · Rust · Typed Functional DSL · Zero-Patch FHS

Experience liftoff with
a typed functional core.

Siphon verified binaries from Debian, Arch, Fedora, openSUSE, Void, Ubuntu, CachyOS, Alpine, Nix, and GitHub Releases / URL tarballs into a kernel-immutable CAS store—running untouched in zero-patch FHS sandboxes with compile-time ABI safety.

Quick Start Explore DSL
9 First-class registries
0 patchelf rewrites
0444 Immutable CAS blobs
ABI Compile-time checked
Source · Typed Functional DSL
❯ graft run examples/cross_distro.graft -- sh -c 'echo "{\"v\":\"cross-distro\"}" | jq -r .v | mawk "{ print toupper(\$0) }"'

            
Why Graft

Functional reproducibility
without rebuilding the world.

Nix proved that purely functional, declarative environments are the right foundation—but left three structural pain points. Graft keeps the purity and lifts away the friction.

01 Language

Typed Functional DSL

Before

Untyped bespoke DSL with rec, with, override, overrideAttrs, finalAttrs, and opaque tracebacks.

With Graft

Structural types, call-site checked lambdas, lazy open records (self / super), one deep-merge operator (&), |> pipelines, and multi-error graft check.

02 Runtime

Zero-Patch FHS Sandboxes

Before

Rewriting every ELF interpreter and RPATH with patchelf to point into hashed store paths—breaking upstream binaries.

With Graft

Zero-copy hardlinked virtual FHS mounted read-only via bwrap / unshare with direct ld-linux / ld-musl fallback. Upstream ELFs run unmodified.

03 Ecosystem

Native Binary Siphoning

Before

Slow monorepo evaluation and massive cache rebuilds just to get standard stable packages.

With Graft

Siphon signed binaries directly from Debian Trixie (-updates & -security), Arch, Fedora, openSUSE, Void, Ubuntu, CachyOS, Alpine, cache.nixos.org, and SHA-256-pinned GitHub Releases / URL tarballs into a deduplicated CAS pinned by graft.lock.

Multi-Ecosystem Siphons

Borrow from every Linux ecosystem, verified and pinned.

Select a registry or archive source to inspect its declaration, snapshot or hash pinning, phantom ABI domain, and CLI usage.

registry.debian

Debian 13 (Trixie) + Security & Snapshots

Pkg<debian:trixie:x86_64>

$
Phantom ABI Types

Mixing incompatible ABIs fails
at compile time—never at runtime.

Every package carries its registry domain in the type system: Pkg<Domain>. Toggle between a direct cross-distro compose and an isolate shim to see how graft check protects your FHS.

Checked statically before a single byte is downloaded
examples/type_error.graft Pkg<debian:trixie:x86_64> vs Pkg<arch:latest:x86_64>
graft check exit 1

            
System Architecture

From typed .graft source to kernel-immutable FHS.

Inspect each stage of the Graft pipeline—from structural type checking and backtracking dependency resolution to hardlinked read-only CAS environments.

Stage 01 · Compiler Frontend

Structural Type Checker & Lazy Open Records

    Engineering Guarantees

    Integrity, hermeticity, and speed built into the store.

    Kernel-Immutable Content-Addressed Store

    Every file in ~/.graft/objects/<2hex>/<sha256>-<mode> is stored strictly read-only (0444/0555). Virtual FHS rootfs trees are assembled via zero-copy hardlinks—so environments share deduplicated blobs while never allowing in-place mutation. Run graft store verify --repair to re-hash and evict any corruption.

    CA Build DAGs with Early Cutoff

    Multi-stage builds hash upstream stage output bytes, not just scripts. If an edited codegen stage emits identical bytes, downstream stages hit cache immediately.

    Exact Vulnerability Audits

    Because binaries stay unmodified, graft audit matches source packages in graft.lock directly against OSV and the Arch Security Tracker with CI-ready --fail-on high --fixable --json.

    Unison-Style Canonical AST Hashing

    graft eval --hashes computes structural hashes that ignore comments, formatting, and alpha-equivalent local variable renames.

    Cryptographic Verification & Offline Replay

    SHA256 chains across Debian InRelease and RPM-MD repomd.xml, gpgv signatures for extra repos and release tarballs, mandatory SHA-256 on archive/github, ed25519 verification for Nix narinfos, plus strict GRAFT_OFFLINE=1 --locked replay.

    Clean Binary Exposure & Atomic Profiles

    graft install, graft home, and isolate(...) expose only the binaries of requested root packages—never leaking transitive tools like ldd or iconv—with full generation diffing (profile diff), instant rollbacks, and garbage collection.

    Language & Tooling

    Expressive syntax. Batteries-included CLI.

    Explore Graft's core types, functional pipelines, built-in functions, and developer tooling from docs/language.md ↗.

    Quick Start

    Try Graft in under two minutes.

    Build from source with Rust 1.85+, install Graft using its own self-hosting graft.graft recipe, and spin up zero-patch cross-distro shells immediately.

    01

    Clone & self-install

    # Clone the repository and self-install graft
    git clone https://github.com/graft-os/graft.git
    cd graft
    cargo run --release -- self-install
    02

    Run ad-hoc tools across distros

    # Zero-patch ad-hoc execution from any registry
    graft run debian#jq -- --version
    graft run fedora#jq -- --version
    graft run void:musl#jq -- --version
    graft run nix#ripgrep -- --version
    03

    Enter a declarative dev shell

    # Auto-detect Rust/Python/Node project & write ./graft.lock
    graft init
    graft develop
    graft lock
    04

    Check, format, audit & inspect

    # CI diagnostics, CVE auditing & closure inspection
    graft check --format github graft.graft
    graft fmt --check graft.graft
    graft audit graft.lock --min-severity high
    graft tree debian#git --why perl
    Open Source · Apache-2.0

    Ready to graft every ecosystem?

    Declarative, statically typed, and kernel-immutable—without patching a single upstream ELF.