WIT-first contract compiler for stable Rust, protobuf, JSON Schema, and versioned adapters
Every witforge command emits structured diagnostics with --format json or --format sarif.
SARIF rules link directly to the per-code anchors on this page, and witforge explain <CODE>
prints any code’s catalogue entry offline from the CLI.
Positions use 1-based lines and 1-based UTF-16 code-unit columns (the SARIF 2.1.0 default).
Physical paths in JSON file fields and SARIF artifactLocation.uri are repository-relative
with forward slashes when inside the working directory; SARIF uses an absolute file:/// URI for
files outside the working directory. Logical WIT paths (such as example:pkg/types/record.field)
appear in logical (JSON) and logicalLocations (SARIF).
WF1001–WF1033)Severity: error
Unrecognised WIT construct outside the supported subset. Legacy umbrella code; individual subset
rules now emit WF1010–WF1030.
Severity: error
A lockfile belongs to another package (namespace:name). Check the wire.lock or --against
baseline path named by the diagnostic.
Severity: error
Two names in one scope collide: either they differ only in ASCII letter case (including against a
reserved lockfile member), or they map to the same generated Rust, protobuf, prost, or glue
identifier, filename, accessor, or reserved name. Rename one of the colliding items.
Severity: error · Prior: WF1001
Root contract package version is missing or not <major>.<minor>.0. Declare
package ns:name@<major>.<minor>.0; with patch 0 and no pre-release or build metadata.
Severity: error · Prior: WF1001
A nested package block was found inside a version directory. Place dependency packages under
the standard deps/ directory instead.
Severity: error · Prior: WF1001
A dependency package under deps/ is missing a version or uses a version other than
<major>.<minor>.0.
Severity: error · Prior: WF1001
Duplicate dependency package identity under deps/, or a dependency declaring the same
namespace:name as the root contract package. Pin one version per dependency package.
Severity: error · Prior: WF1001
Unsupported WIT annotation (such as @external-id). Only @since, @unstable, and @deprecated
are accepted.
Severity: error · Prior: WF1001
Resources and handles (resource, borrow<T>, own<T>) are not supported. Model state as pure
values passed to freestanding functions.
Severity: error · Prior: WF1001
future and stream types are not supported; witforge contracts are synchronous.
Severity: error · Prior: WF1001
char is not supported; use string.
Severity: error · Prior: WF1001
error-context is not supported; model errors as explicit records, enums, or variants in
result<T, E>.
Severity: error · Prior: WF1001
Tuples are not supported; define a named record so every field has a stable wire number.
Severity: error · Prior: WF1001
map is not supported yet; use list<record> with explicit key and value fields.
Severity: error · Prior: WF1001
Fixed-length lists are not supported; use list<T>.
Severity: error · Prior: WF1001
Empty records are not supported; add a field or use a payload-less variant case.
Severity: error · Prior: WF1001
async functions are not supported; witforge contracts are synchronous.
Severity: error · Prior: WF1001
get and set accessors are not supported; use ordinary functions.
Severity: error · Prior: WF1001
Inline interfaces in a world are not supported; declare a named interface and import or export
it from the world.
Severity: error · Prior: WF1001
Named (renamed) interface imports or exports in a world are not supported; import or export the
interface directly without a local alias.
Severity: error · Prior: WF1001
Functions defined directly in a world are not supported; place functions inside a named
interface and export that interface from the world.
Severity: error · Prior: WF1001
Types defined directly in a world are not supported; define types inside a named interface.
Severity: error · Prior: WF1001
A world imports or exports an interface with no package or from a package outside deps/.
Severity: error · Prior: WF1001
Type nesting depth, alias chain depth, canonical type byte length, synthesized protobuf wrapper name length, or canonical type cycle limit was exceeded.
Severity: error
Version directory name (v<major>.<minor>) disagrees with its declared WIT package version
(<major>.<minor>.0).
Severity: error
Versions in a WIT root or the two endpoints of diff declare different package identities
(namespace:name).
Severity: error
Pinned dependency graphs differ across versions under a WIT root, across diff endpoints, or
against a version-directory --against baseline.
WF1100–WF1205)Severity: error
Lockfile continuity, drift evaluation, order-section, or baseline-policy violation. When a live
member disagrees with its locked entry, the related location points at the conflicting line in
wire.lock.
Severity: error
A live contract member has no wire number in wire.lock. Run the suggested witforge lock
command to assign one.
Severity: error
A removed contract member is still unreserved in wire.lock. Run witforge lock to mark it
reserved.
Severity: error
A removed member was reintroduced under its reserved name and wire number. Give the member a new
name (or use --against with the released baseline if the removal was only a draft).
Severity: error
A stale draft entry remains in wire.lock. Run witforge lock to drop it.
Severity: error
A draft member changed kind or canonical type since wire.lock was written. Run witforge lock
to update the draft entry.
Severity: error
wire.lock is not in the canonical formatting produced by witforge lock. Run witforge lock to
rewrite it canonically.
Severity: note
The pinned dependency graph could not be compared because --against does not point to a
version-directory wire.lock.
Severity: error
A draft removal can be restored; running witforge lock --against will un-reserve the member.
Severity: error
A released version directory listed in wit/released changed after release, had an entry removed
from wit/released, contains a symlink or untracked file, or lacks a git-tracked wire.lock under
its exact spelling. Restore the released directory and manifest rather than editing a released
version in place.
Severity: note
witforge lock assigned a wire number to a newly added member.
Severity: note
witforge lock marked a removed member as reserved.
Severity: note
witforge lock dropped a stale draft entry.
Severity: note
witforge lock updated a draft member’s kind or canonical type.
Severity: note
witforge lock restored a draft removal.
WF2001–WF2002)Severity: error
Generated output is missing, changed, extra, or otherwise out of sync with --check. Re-run the
suggested generator command.
Severity: error
Version-to-version Rust conversion generation (convert.rs) refused an incompatible evolution
between adjacent versions (such as adding a non-defaulted record field or retyping a member).
WF3001–WF3004)Severity: error (breaking a gated view under --check[=<views>]) or warning (un-gated)
witforge diff found a wire-, source-, or generated-API-breaking change. Without --check,
diff exits 0 and emits WF3001 at level warning; with --check or --check=<views>,
diff exits 1 and emits WF3001 at level error for changes breaking a gated view (and
warning for breaking changes outside the gated views).
Severity: note
witforge diff found a compatible change.
Severity: note
witforge diff found a record whose generated new-to-old conversion is guaranteed to fail because
the older version requires a member removed in the newer version.
Severity: note
witforge diff found a non-defaulted record field addition or retyped member that will cause
convert.rs generation to refuse.
WF9000–WF9004)Severity: error
Internal compiler error (unexpected invariant failure only; never emitted for usage, I/O, parse, or safety-guard errors).
Severity: error
Command-line usage or argument error (invalid flags, missing required arguments, reversed diff
endpoints, invalid module root). Exits 2.
Severity: error
Filesystem or I/O error (missing file, directory, or lockfile; permission denied; unreadable path;
write failure). Exits 2.
Severity: error
Parse or format error (invalid WIT syntax or name resolution error, malformed wire.lock,
malformed released manifest, or invalid witforge.toml / BOM). Exits 2.
Severity: error
Safety guard or freeze-policy refusal (locking or writing into a released directory, symlinked
version directory or symlink inside a released directory, overlapping or unowned output path,
non-canonical v... directory name, or unexpanded shell path in witforge.toml). Exits 2.