faultbox 0.1.0

Production black-box recorder: structured crash, corruption, and invariant-violation reports with a flight-recorder breadcrumb trail — debuggable from a report without reproduction or shipped symbols.
Documentation
# Reusable tag/version validation. Called by release-prepare.yml (from the
# pushed tag) and release.yml (from the dispatched tag), so the two entry
# points can never disagree about what a tag means.

name: Release Validate

on:
  workflow_call:
    inputs:
      ref:
        description: "Git ref to validate (a v* tag)"
        required: true
        type: string
    outputs:
      version:
        description: "Tag version without the leading v"
        value: ${{ jobs.validate.outputs.version }}
      is_full_release:
        description: "true when the version carries no prerelease suffix"
        value: ${{ jobs.validate.outputs.is_full_release }}

permissions:
  contents: read

jobs:
  validate:
    name: Validate Version Tag
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.version.outputs.version }}
      is_full_release: ${{ steps.version.outputs.is_full_release }}
    steps:
      - uses: actions/checkout@v7
        with:
          ref: ${{ inputs.ref }}

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Validate tag against Cargo.toml
        id: version
        env:
          TAG: ${{ inputs.ref }}
        run: |
          TAG_VERSION="${TAG#v}"

          CARGO_VERSION=$(cargo metadata --no-deps --format-version=1 \
            | jq -r '.packages[] | select(.name == "faultbox") | .version')
          CARGO_BASE=$(echo "$CARGO_VERSION" | grep -oP '^\d+\.\d+\.\d+')

          echo "Tag version:        $TAG_VERSION"
          echo "Cargo.toml version: $CARGO_VERSION"
          echo "Cargo.toml base:    $CARGO_BASE"

          if [[ ! "$TAG_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)(-[a-zA-Z]+\.[0-9]+)?$ ]]; then
            echo "::error::Invalid tag format '$TAG'. Expected: vX.Y.Z or vX.Y.Z-label.N"
            exit 1
          fi

          TAG_BASE="${BASH_REMATCH[1]}"

          if [[ "$TAG_BASE" != "$CARGO_BASE" ]]; then
            echo "::error::Base version mismatch! Tag '$TAG_BASE' != Cargo.toml '$CARGO_BASE'"
            exit 1
          fi

          # Full release = no hyphen suffix (v0.1.0, not v0.1.0-beta.1)
          if [[ "$TAG_VERSION" == *-* ]]; then
            echo "is_full_release=false" >> "$GITHUB_OUTPUT"
          else
            echo "is_full_release=true" >> "$GITHUB_OUTPUT"
          fi

          echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT"