Skip to content

witforge 0.7.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 21:37
· 6 commits to main since this release

0.7.0 is the final planned pre-1.0 Rust-library source break. Library consumers must apply the
W10-094, W10-095, and W10-096 migration notes below before moving their dependency.

Generated output changes for every contract that uses @since, @unstable, or @deprecated:
regenerate and commit plain Rust, protobuf, JSON Schema, glue, and shared metadata together.
Contracts without stability annotations do not gain those comments or deprecation attributes,
but should still run every generator with --check. Invalid annotation versions newly fail
validation as documented under W10-094. Wire numbers and lockfile identity do not change.

Added

  • Adopter & contributor documentation and dual GitHub/Pages link checking (W10-091, W10-092):
    • Added docs/guide/wiring.md (empty crate to compiling prost/protox
      round trip, verified by wiring_guide_crate_generates_compiles_and_roundtrips, prebuilt
      archive checksum/attestation verification, and --lock/--released/released options),
      docs/guide/reference.md (complete CLI & witforge.toml
      reference verified against Cli::command()), and
      docs/guide/migration.md (per-release generated-output migration
      index linking to CHANGELOG.md sections).
    • Added CONTRIBUTING.md, GitHub issue forms (.github/ISSUE_TEMPLATE/),
      and .github/PULL_REQUEST_TEMPLATE.md; enabled jekyll-relative-links in docs/_config.yml,
      converted all internal docs/ links to .md, and added dual GitHub/Pages link and anchor
      verification (documentation_links_and_anchors_resolve_on_github_and_pages).
  • Structure-aware fuzz target, tracked seed corpus, and asserted invariants (W10-089):
    • Added a tracked fixture-derived seed corpus under fuzz/seeds/, a WIT keyword dictionary
      (fuzz/wit.dict), and the structure-aware structured-contract target exercising one-letter
      and upper-case names, multiple .wit files, and deps/ packages.
    • Updated wit-package and structured-contract to assert full compiler invariants (generation
      success across all four emitters, determinism, canonical/idempotent lockfiles, empty
      self-diff, and two-version conversion) and added the matching fixed-seed property test
      structured_contracts_satisfy_fuzz_invariants to the stable suite.
  • GitHub Action ref-pinned versions, against/format/sarif-file/binary, annotations, and
    failed-command (W10-086):
    • Non-tag refs (commit SHAs, branches, floating tags, and local ./) now install the workspace
      version from Cargo.toml in the Action's own tree instead of silently floating to latest
      (latest is installed only when version: latest is passed explicitly; missing assets fail
      naming version).
    • Added against, format (human/json/sarif), sarif-file, and binary inputs plus
      failed-command and sarif-file outputs, pre-download input validation, bounded retries on
      transient network/5xx errors (never retrying 4xx or checksum mismatches), archive/checksum
      scratch cleanup, and GitHub workflow annotations (::error file=...,line=...,col=...::...)
      on failing checks.
  • Atomic releases, SLSA build provenance, Linux arm64, archive licenses, and crate metadata
    (W10-087, W10-090):
    • Reordered .github/workflows/release.yml so platform binaries (including linux/arm64 /
      aarch64-unknown-linux-gnu) are built, attested via actions/attest-build-provenance, and
      smoke-tested from workflow artifacts before publishing crates (using --no-verify after
      verifying .crate SHA-256 digests against the unprivileged verify job) or creating a
      draft-first GitHub release without --clobber. The Action verifies build provenance with
      gh attestation verify on releases 0.7.0+ before extracting.
    • Normalized Windows runner scratch paths before GNU tar extraction so the required Windows
      pre-publish archive smoke runs before trusted publication.
    • Corrected the immutable crates-io-auth-action v1.0.6 commit pin used for trusted OIDC
      publishing.
    • Included LICENSE-APACHE, LICENSE-MIT, and README.md in every release archive, added
      homepage/documentation/[package.metadata.binstall] crate metadata, excluded tests/
      from the published witforge library crate, enabled GitHub Private Vulnerability Reporting,
      documented the threat model and download verification in SECURITY.md, and ignored local-only
      paths (/.private/, /.github-account) in .gitignore.
  • CI concurrency, weekly schedule, pinned lint toolchain, and benchmark ceilings (W10-088):
    • Grouped main CI runs per commit so no commit is cancelled while pending, pinned the gating
      Rust lint toolchain (1.100.0) with a weekly scheduled floating-stable + fuzz-smoke +
      security run, removed retired self-hosted runner leftovers and unused ci/deny.toml
      licenses, made every ci/*.sh script default scratch to ${TMPDIR:-$HOME/.tmp}, cached
      historical buf baseline binaries in manual CI only, and tightened tests/bench.rs release
      ceilings to ~10x hosted-runner baselines.
  • Protobuf binary decode-compatibility view in diff (W10-097):
    • Added a directional decode compatibility view (new_reads_old and old_reads_new) to
      witforge diff, modelling two processes speaking the same major's protobuf schema over binary
      encoding under the documented decode profile (distinguishing option<T> and non-byte list<T>
      from required fields and optional bytes list<u8>, closed enum/variant cases, flags,
      functions, and parameters).
    • Extended diff --check=<views> to accept decode (for example --check=decode or
      --check=wire,decode); bare --check continues to gate on wire,source,api without decode
      by default.
    • Added additive JSON fields (decode_breaking, new_reads_old, old_reads_new per change and
      decode_breaking, new_reads_old_breaking, old_reads_new_breaking in summary) and
      additive library types/functions (diff::DecodeVerdict, diff::DecodeSummary,
      diff::FullDiff, diff::compare_full).
  • Major-version boundaries, partial cross-major adapters, per-major dependencies, and version retirement (W10-093):
    • Across a major-version boundary (old.major != new.major), witforge rust no longer refuses
      breaking changes: plain types for every live version are always written, convert.rs generates
      adapters for every type that still converts, and non-convertible types (and types containing
      them transitively) are omitted per direction with a deterministic sorted comment block at the
      top of convert.rs. Intra-major incompatible evolutions remain refused (WF2002).
    • witforge diff across a major boundary now permits changed, added, removed, or upgraded
      dependencies and reports the exact same per-direction omission set as convert.rs (human
      notes, --json conversion_omissions, WF3004 notes in --format json|sarif, plus additive
      library APIs diff::ConversionOmission, diff::compare_omissions, and
      diff::compare_with_omissions).
    • Pinned dependency-graph identity is now enforced per major rather than across majors: identical
      dependencies stay at the shared witforge_deps::<ns>_<pkg> / <ns>.<pkg>.v<dep_major> paths,
      while dependencies that change or upgrade across live majors are scoped per root major across
      Rust, protobuf, JSON Schema, and glue.
    • Added <name> retired entries in wit/released (with ReleasedManifest::is_retired,
      retired_directories, live_directories, and validate_retirement_order): retiring a
      contiguous oldest prefix of versions keeps their directories frozen on disk while removing them
      from generated output (and drops a major's .proto and glue once all its versions are
      retired). witforge freeze accepts the one-way live -> retired transition and refuses
      un-retiring, removals, or edits to retired directories.
  • Built-in release-freeze verification (witforge freeze, W10-083):
    • Added witforge freeze [<WIT_ROOT>] [--config PATH] [--project NAME] [--base REV] and the
      witforge::freeze library module enforcing the Git-history release-freeze rule across
      platforms (including shallow-clone refusal with exit 2 / WF9004, core.autocrlf=true,
      full-history rename tracking stopping at copies, symlink/untracked/case-sensitive wire.lock
      hygiene, multi-project config runs, and full violation collection under WF1109).
    • Reduced ci/check-release-freeze.sh to a thin wrapper over witforge freeze and added the
      freeze input to the GitHub Action.
  • High-level contract workflow commands and upward witforge.toml discovery (W10-084):
    • Added witforge generate, witforge new-version [--major], witforge release <WIT_DIR>,
      whole-WIT-root and config-driven witforge check, and upward witforge.toml discovery
      (stopping at .git or filesystem root, with --no-config opt-out and safe preservation of
      self-contained explicit CLI invocations).
  • Build identity, --quiet, per-view diff --check, shell completions, and explain (W10-085):
    • witforge --version now includes the short Git commit (and -dirty when tracked files have
      local edits) on development builds, printing the bare version on exact clean release tags and
      builds without Git metadata (with no embedded timestamps).
    • Added global --quiet / -q to suppress human notes and summaries without suppressing errors,
      changing exit codes, or modifying JSON/SARIF output.
    • Extended witforge diff --check to accept --check=<views> (wire, source, api,
      comma-separated; defaults to all three) and mapped the GitHub Action's diff-check input onto
      it.
    • Added witforge completions <bash|zsh|fish> generated directly from the clap command tree,
      and witforge explain <CODE> backed by witforge::diagnostic::explanation as a single source
      of truth verified against docs/design/diagnostics.md.

Changed

  • Consumer-visible stability and deprecation metadata (W10-094):

    • Added Stability::Deprecated with the WIT introduction/feature origin, deprecation version,
      and deterministic note. Invalid annotation versions are refused, and WIT-root checks plus all
      generators verify @since against the first declaration when the claimed version is present.
    • Plain Rust now emits stability docs and #[deprecated]; protobuf emits stability comments,
      deprecated = true options, and deprecated method-enum values; JSON Schema emits stability
      descriptions and "deprecated": true. Generated Rust, prost, conversion, and glue code
      compile under denied deprecation warnings without suppressing warnings in consumer code.
    • diff reports introduction, unstable-feature, deprecation, and undeprecation changes as
      non-breaking stability-changed entries in human and JSON output.
    • Library migration: ChangeKind is deliberately exhaustive and gains the final pre-1.0
      StabilityChanged { from, to } variant; exhaustive 0.6 matches must add that arm for 0.7.
      Matches on Stability already require a wildcard because it is #[non_exhaustive].
  • Extensible library data types and a machine-checked public API inventory (W10-095):

    • Marked every public struct and enum in model, lock, and diagnostic
      #[non_exhaustive], and added constructors for model values, lockfile inputs, source
      positions, and related locations. Downstream exhaustive matches now require a wildcard arm,
      and downstream struct literals must use the documented constructors, Default, parsers, or
      builders.
    • Added a pinned-rustdoc, machine-checked inventory of every public item, field and function
      signature, variant, associated item, explicit trait implementation, and extensibility
      attribute. Through the 0.7.0 tag commit, the gate requires the complete API delta from 0.6.0
      to equal the reviewed pre-1.0 inventory, while cargo-semver-checks separately requires its
      detected failures to equal the checked exception. On descendants of the tag, the tag's
      inventory becomes the signature-aware baseline: removals and type/signature changes fail,
      while reviewed additive entries remain possible. Removed the unused
      emit::output::absolute function and made the four internal model size-limit constants
      private.
    • Library migration: this is the planned pre-1.0 source break. Search library consumers for
      struct literals of witforge::model, witforge::lock, or witforge::diagnostic values and
      for exhaustive matches on their enums; replace literals with constructors and add wildcard
      match arms. Replace any use of emit::output::absolute with std::path::absolute, and do not
      depend on the former internal model limit constants.
  • Library-owned check/lock workflows, in-memory loading, and typed findings (W10-096):

    • Added SourceFile / load_sources for deterministic in-memory root and textual deps/
      packages with physical source names and positions, and moved single-version/root check plus
      side-effect-free lock reconciliation into witforge::workflow. LockReport exposes canonical
      text and writes only through an explicit method; the CLI retains configuration parsing,
      rendering, and exit-status policy.
    • Replaced generator Vec<String> drift results with GeneratedFileFinding /
      GeneratedFileStatus, and replaced diff::Change.element: String with ChangeElement.
      Generated-output paths and diff categories are now typed end to end; the CLI no longer derives
      structure from message text. Human, JSON, and SARIF output remain unchanged.
    • Library migration: callers of emitter check functions inspect each finding's path and
      status (or call message / diagnostic) instead of parsing strings. Diff callers match
      ChangeElement instead of comparing Change.element with string literals. witforge.toml
      remains a CLI-only configuration model; library/build-script callers pass options directly.
  • Source positions, SARIF 2.1.0 physical/logical/related locations, and public diagnostic guide (W10-080):

    • Structured diagnostics (JSON and SARIF) now report physical file paths (cwd-relative with /
      or percent-encoded file:/// URIs outside cwd, never .. or Windows \\?\), 1-based UTF-16
      line/column ranges (handling tabs, BMP/supplementary characters, CRLF, and leading UTF-8 BOMs),
      logical / logicalLocations, related / relatedLocations (pairing WIT declarations with
      their conflicting wire.lock line), SARIF rule shortDescription + helpUri pointing at
      the new public docs/guide/diagnostics.md reference, rendered wit-parser error snippets,
      and exit-aligned diff SARIF levels (warning on zero-exit runs, error on failing gates).
  • Per-rule diagnostic codes and cross-command machine-readable parity (W10-079):

    • Subset violations previously reported under the single umbrella code WF1001 are now split
      into one stable code per rule (WF1010–WF1030; WF1001 remains for unrecognised constructs
      and is recorded in the Prior column of docs/design/diagnostics.md beside every split
      code). Consumers filtering JSON or SARIF reports on WF1001 should update filters to the
      specific WF1010–WF1030 codes or match the WF10 prefix.
    • Generators (rust, proto, schema, glue), diff, check, and lock now emit the same
      diagnostic code, path, and message for every contract violation, and preserve multiple
      violations as separate diagnostics instead of joining them with "; " into a single WF9000.
    • WF9000 is now strictly reserved for internal compiler errors. Usage/argument errors emit
      WF9001 (including early argument-parsing errors when --format json or --format sarif is
      present on the command line, printed to stdout with exit 2), filesystem/I/O errors emit
      WF9002, WIT/lockfile/manifest/config parse errors emit WF9003, and safety-guard/freeze
      refusals emit WF9004.
    • lock --against and check --against now both emit WF1002 for a foreign-package lockfile,
      with path naming the offending file (the current lockfile or the baseline file).
    • diff --json --format sarif suppresses the diagnostic envelope on both success and error so
      --json always takes precedence.
  • Output mode preservation, unchanged-file skip, and --check / --diff explanations (W10-076):

    • Generators now skip rewriting expected files whose on-disk bytes already match (preserving
      inode, modification time, and permissions), preserve replaced files' permission bits during
      atomic replacement, use process-unique temporary siblings (.witforge.<name>.<pid>.<seq>.tmp)
      so concurrent runs into one root do not delete each other's temporaries, and ignore unreadable
      unrelated files.
    • --check now names the regenerating command (preserving --config / --project or explicit
      paths) and prints the first differing line or a core.autocrlf CRLF-only hint for changed
      files. All four generator commands gain --diff to print a unified diff without changing exit
      status.
  • Stricter version-directory discovery, UTF-8 BOM handling, and config path guards (W10-082):

    • Version-like entries starting with v/V followed by a digit that are not canonical
      v<major>.<minor> directories (v0.2.0, V0.2, v0.2-rc1, v00.2, v1, non-directories)
      are refused instead of silently skipped.
    • wit/released accepts a leading UTF-8 BOM; WIT parse errors note when a file begins with a
      UTF-8 BOM; witforge.toml refuses a leading UTF-8 BOM and refuses unexpanded shell paths
      (~, $VAR, %VAR%).
  • Accurate error remedies and runnable commands (W10-081):

    • Reversed diff endpoints report the versions in the right order with a quoted runnable command;
      every missing/stale lockfile hint quotes paths and prints a runnable --first or --against
      command; check and lock on a WIT root list the discovered version directories with a
      runnable example command.
  • Specified --serde format-independence, serde_json limits, and JSON names (W10-071):

    • Documented --serde's format-independent derives, exact Rust-spelled JSON keys (self_,
      type, folded upper-case names, "DoneNow", variant/flags/byte-list/result encodings),
      differences from JSON Schema reading rules and convert.rs cross-version defaults, and exact
      serde_json limitations (Some(None) on nested options, non-finite floats), pinned by an
      expanded serde fixture and compile/round-trip test.