No description
  • Rust 84.6%
  • Shell 4.8%
  • JavaScript 4%
  • Python 2.1%
  • Astro 1.2%
  • Other 3.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
asamarts fa8bd1259b
Some checks failed
CI / polyglot conformance (python (google.protobuf)) (push) Waiting to run
CI / polyglot conformance (rust (prost + pbjson)) (push) Waiting to run
CI / polyglot conformance (typescript (protobuf-es)) (push) Waiting to run
CI / published Action (macos-15) (push) Waiting to run
CI / published Action (macos-15-intel) (push) Waiting to run
CI / published Action (ubuntu-24.04-arm) (push) Waiting to run
CI / published Action (windows-latest) (push) Waiting to run
CI / test (macos-15) (push) Waiting to run
CI / test (ubuntu-latest) (push) Waiting to run
CI / test (windows-latest) (push) Waiting to run
CI / MSRV (1.88) (push) Waiting to run
CI / static musl binary (aarch64-unknown-linux-musl) (push) Waiting to run
CI / static musl binary (x86_64-unknown-linux-musl) (push) Waiting to run
CI / package (publish dry run) (push) Waiting to run
CI / public API compatibility (push) Waiting to run
CI / documented public API (push) Waiting to run
CI / benchmark budget (push) Waiting to run
CI / advisories and dependency policy (push) Waiting to run
CI / aplan plan (push) Waiting to run
CI / generated output and release freeze (push) Waiting to run
CI / optional historical buf breaking (push) Has been skipped
CI / weekly floating stable check (push) Has been skipped
CI / weekly fuzz smoke (push) Has been skipped
CI / polyglot conformance (csharp .net 8 (Google.Protobuf)) (push) Waiting to run
CI / polyglot conformance (go (google.golang.org/protobuf)) (push) Waiting to run
CI / polyglot conformance (java 21 (protobuf-java)) (push) Waiting to run
CI / ci ok (push) Blocked by required conditions
CI / fmt, clippy, docs (push) Failing after 3s
CI / workflows and scripts (push) Failing after 5s
CI / published Action (ubuntu-latest) (push) Failing after 8s
Close W10-140 and restamp W2-007
2026-12-03 20:37:50 -05:00
.github Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
action Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00
aplan Close W10-140 and restamp W2-007 2026-12-03 20:37:50 -05:00
ci Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
crates Prepare 0.12.0 release (W10-139) 2026-12-03 01:25:18 -05:00
docs Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
examples Close post-0.11.0 audit findings (W10-137) 2026-12-02 18:48:03 -05:00
fuzz Prepare 0.12.0 release (W10-139) 2026-12-03 01:25:18 -05:00
packaging Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
site Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
.aplan.yml Add optional witforge-build helper crate (W10-112) 2026-11-24 03:07:11 -05:00
.gitattributes Harden W14-006 plugin starter kits, site install tabs, and release smokes 2026-12-02 14:22:25 -05:00
.gitignore Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00
action.yml Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00
AGENTS.md Close post-0.11.0 audit findings (W10-137) 2026-12-02 18:48:03 -05:00
Cargo.lock Prepare 0.12.0 release (W10-139) 2026-12-03 01:25:18 -05:00
Cargo.toml Prepare 0.12.0 release (W10-139) 2026-12-03 01:25:18 -05:00
CHANGELOG.md Pin CI Action to v0.12.0 and record 0.12.0 release evidence (W10-139) 2026-12-03 13:00:00 -05:00
CLAUDE.md plan: adopt aplan for tasking and dogfooding 2026-10-27 01:18:36 -04:00
CONTRIBUTING.md Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00
LICENSE-APACHE feat: witforge foundations (subset checker and wire lockfile) 2026-10-14 17:57:00 -04:00
LICENSE-MIT release: name witforge, not adotenv, as the MIT copyright holder 2026-10-31 19:46:14 -04:00
README.md Add guarded NuGet OIDC publish job and update distribution channel docs (W10-140) 2026-12-03 20:37:40 -05:00
ROADMAP.md Pin CI Action to v0.12.0 and record 0.12.0 release evidence (W10-139) 2026-12-03 13:00:00 -05:00
SECURITY.md Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00
wrangler.jsonc Migrate repository, site, Action, packaging, and docs to zeropier/witforge and witforge.org (W10-138) 2026-12-03 00:57:09 -05:00

witforge

CI crates.io docs API docs MSRV

Compile one hand-written WIT contract into the runtime-independent artifacts its consumers need.

witforge checks a deliberately portable WIT subset, locks protobuf field and method numbers, and generates deterministic plain types, version adapters, and checked protobuf glue across Rust, TypeScript, Python, Go, Java, and C#, plus protobuf schemas, JSON Schema, Markdown docs, cross-language conformance fixtures, compatibility reports, and third-party emitter plugins.

Current release: 0.12.0. The 1.0 release remains intentionally gated on successful independent consumer validation.

Outputs

Output Purpose
Plain Rust Owned structs, enums, interface traits, world metadata, and opt-in Serde, no_std, and Eq/Hash
Polyglot plain types Zero-dependency types, interfaces, and world metadata for TypeScript (ts), Python (py), Go (go), Java 21 (java), and C# 12 (csharp)
Protobuf Messages and method IDs with append-only numbers from wire.lock and opt-in Go/Java/C# file options
JSON Schema Draft 7 (default) and opt-in Draft 2020-12 definitions for WIT-shaped values
Checked protobuf glue Validated plain-to-proto conversion for Rust (glue), TypeScript (ts-glue), Python (py-glue), Go (go-glue), Java (java-glue), and C# (csharp-glue)
Version adapters Old-to-new and new-to-old conversion between adjacent versions in Rust (convert.rs, opt-in TryFrom), TypeScript, Python, Go, Java, and C#
Markdown docs & conformance Deterministic Markdown contract reference (witforge doc) and cross-language protobuf conformance fixtures (witforge conformance)
Diff, IR, plugins, and diagnostics Human, JSON, and SARIF compatibility reports (diff --git-base, policies), versioned JSON contract IR (inspect), and opt-in third-party emitter plugins (plugin)

When it fits

Use witforge when:

  • hand-written WIT is the source of truth;
  • the callable contract is pure, synchronous, and value-oriented;
  • native Rust and polyglot or out-of-process implementations share the same semantic values;
  • protobuf identity must remain stable across releases;
  • generated output is committed and checked in CI;
  • contract changes need explicit compatibility review.

Use wit-bindgen and a Component Model runtime directly when you only need guest and host Component Model bindings.

witforge does not load components, generate protobuf services, own process framing, or define callbacks, retries, capabilities, resource limits, discovery, or failure policy. TypeScript, Python, Go, Java, and C# have built-in plain-type, adapter, and checked-glue emitters; other ecosystems can use the emitted protobuf schema with the documented WIT decode profile and witforge conformance bundle, or target new languages via third-party emitter plugins.

Install

cargo install witforge-cli --version 0.12.0 --locked
witforge --version
Channel Command / Coordinate Guide
Rust (crates.io / binstall) cargo install witforge-cli --version 0.12.0 --locked or cargo binstall witforge-cli Wiring and install
Node / TypeScript (npm / npx) npx --yes @witforge/cli@0.12.0 --version npm install
macOS / Linux / Go (brew / mise) brew install zeropier/tap/witforge or mise use aqua:zeropier/witforge@<version> (upstream aqua PR pending; local registry ready) Homebrew, aqua, and mise
Python (PyPI / uvx / pip) uvx witforge==<version> --version or pip install witforge==<version> (PyPI OIDC armed for next release) PyPI install
.NET 8+ / JVM 21+ Witforge.Tools (MSBuild NuGet, OIDC-ready) and org.witforge:witforge-native:<v>:<classifier>@exe (workflow artifact / local feed) NuGet and Maven
GitHub Actions uses: zeropier/witforge@v0.12.0 CI guide

Prebuilt archives (carrying LICENSE-APACHE, LICENSE-MIT, and README.md beside the binary), .sha256 checksums, and (from 0.7.0) SLSA build provenance attestations are published for Linux x86_64 and Linux arm64 (static musl from 0.8.0 alongside gnu), macOS Intel and Apple silicon, and Windows x86_64 (witforge-cli also publishes cargo-binstall metadata). Windows arm64 builds are not provided; install from crates.io with cargo install on that platform.

Five-minute example

Create wit/v0.1/contract.wit:

package example:checker@0.1.0;

interface api {
  record request {
    text: string,
  }

  record diagnostic {
    start: u32,
    end: u32,
    message: string,
  }

  check: func(input: request) -> list<diagnostic>;
}

world plugin {
  export api;
}

Lock and validate the first version:

witforge lock wit/v0.1 --first
witforge check wit/v0.1

Generate the projections:

witforge rust wit --out generated/rust
witforge proto wit --out generated/proto
witforge schema wit --out generated/schema
witforge glue wit --out generated/glue \
  --plain-root crate::plain \
  --proto-root crate::proto

Every generator supports --check, which writes nothing and fails when committed output differs.

What gets generated

For the WIT above, the generated Rust module contains ordinary owned values and a trait:

pub mod api {
    #[derive(Debug, Clone, PartialEq)]
    pub struct Request {
        pub text: ::std::string::String,
    }

    #[derive(Debug, Clone, PartialEq)]
    pub struct Diagnostic {
        pub start: u32,
        pub end: u32,
        pub message: ::std::string::String,
    }

    pub trait Api {
        fn check(&self, input: Request) -> ::std::vec::Vec<Diagnostic>;
    }
}

The same contract becomes protobuf messages and a locked method ID:

message ApiRequest {
  optional string text = 1;
}

message ApiDiagnostic {
  optional uint32 start = 1;
  optional uint32 end = 2;
  optional string message = 3;
}

message ApiCheckRequest {
  ApiRequest input = 1;
}

message ApiCheckResponse {
  repeated ApiDiagnostic result = 1;
}

enum ApiMethod {
  API_METHOD_UNSPECIFIED = 0;
  API_METHOD_CHECK = 1;
}

These excerpts are checked against current emitter output by the test suite, not hand-designed target APIs. The generated-output guide shows complete Rust, protobuf, JSON Schema, glue, version-adapter, and polyglot (TypeScript, Python, Go, Java, and C#) examples with links to committed generated files.

For configuration, dependencies, evolution, and complete command sequences, continue with the documentation or the repository quickstart.

Evolve a contract

Keep each contract version in its own directory. Start a new minor as a copy of the previous version, lockfile included:

mkdir wit/v0.2
cp wit/v0.1/contract.wit wit/v0.1/wire.lock wit/v0.2/
# Edit wit/v0.2/contract.wit: set the package version to 0.2.0, then change the contract.
witforge lock wit/v0.2 --against wit/v0.1/wire.lock
witforge check wit/v0.2 --against wit/v0.1/wire.lock
witforge diff wit/v0.1 wit/v0.2

Released WIT, lockfiles, dependency packages, and generated per-version modules are immutable. Create a new version directory instead of editing a released one (or use the shorthand workflow commands witforge init, witforge release, witforge new-version, witforge deps sync, witforge retire, witforge check <root>, witforge generate, witforge diff --git-base, witforge inspect, and witforge freeze with automatic witforge.toml discovery).

Add --check when CI must reject source- or generated-API-breaking changes. The evolved repository example intentionally adds defaultable fields, so its adapters can convert old values even though diff --check reports the source/API change.

CI

Pin the Action to the same release used locally:

- uses: zeropier/witforge@v0.12.0
  with:
    check: wit/v0.2
    config: witforge.toml
    generators: rust,proto,schema,glue
- run: witforge diff wit/v0.1 wit/v0.2

The Action downloads the matching checksum-verified release binary, leaves witforge on PATH, and runs the configured generators with --check. The second step prints the contract diff. Add --check to it to fail the job on a wire-, source-, or generated-API-breaking change, which includes an added record field. The Action also has diff-old, diff-new, and diff-check inputs (supported from v0.6.0; releases up to v0.5.0 ignored them). See the CI guide.

Important JSON boundary

Rust Serde and JSON Schema project the same WIT values, but they do not define one identical JSON wire format. Rust fields are snake_case; JSON Schema preserves WIT spelling, normally kebab-case. WIT option<T> permits null but does not make a schema property omittable.

Read JSON projections before choosing a JSON boundary.

Documentation and examples

The first consumer is the alint plugin contract. Task-level planning and closure evidence live under aplan/; ROADMAP.md is the narrative sequence.

Security

Report vulnerabilities through GitHub private vulnerability reporting, not a public issue. See SECURITY.md.

License

Licensed under either Apache-2.0 or MIT, at your option.