moadim 0.19.0

Loop engine for AI agents — routines over REST, MCP, and a built-in web UI
name: Lint

# Mirror the local pre-push hook's format and lint gates (`cargo fmt --check`
# and `cargo clippy`) in CI, so style and lint regressions are caught on every
# PR even when a contributor hasn't installed the git hooks. HEAD has
# historically drifted out of clippy/fmt compliance between hook runs; this gate
# keeps `main` green against the same standard the hook enforces locally.
#
# fmt and clippy run as separate jobs so a formatting failure and a lint failure
# are reported independently. The build relies on the committed `prebuilt.html`
# (build.rs falls back to it when trunk is absent), so no trunk step is needed
# just to type-check and lint. The clippy job runs `--workspace` so the `ui`
# member crate is linted too; `ui`'s deps (yew/gloo/web-sys) build fine on the
# host target for clippy's purposes, so no wasm32 target install is required
# here either.

on:
  pull_request:
  push:
    branches: [main]

# Cancel a stale run when a PR gets a new push, so superseded lint runs don't
# pile up and burn CI minutes. Scoped per-workflow-per-ref so unrelated PRs
# (and the push-to-main trigger) never cancel each other.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Install Rust (with rustfmt)
        uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
          components: rustfmt

      - name: Check formatting
        run: cargo fmt --check

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Install Rust (with clippy)
        uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
        with:
          toolchain: stable
          components: clippy

      - name: Cache cargo registry and target/
        uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
        with:
          # Scoped so the `clippy` job's --all-targets target/ artifacts
          # don't clobber the `test` job's cache entry.
          shared-key: clippy

      - name: Run clippy
        # Match the local pre-push hook exactly: this is a non-virtual
        # workspace (the root Cargo.toml declares both a [package] and a
        # [workspace]), so a bare `cargo clippy` only checks the root
        # `moadim` package and silently skips the `ui` member crate. Without
        # `--workspace`, `ui/Cargo.toml`'s `[lints.clippy] all = "deny"` was
        # never enforced here, so a PR could lint-regress the dashboard and
        # still go fully green.
        run: cargo clippy --workspace --all-targets -- -D warnings