diff --git a/.github/ci-policy.md b/.github/ci-policy.md index 30eafe074d..9a914ea125 100644 --- a/.github/ci-policy.md +++ b/.github/ci-policy.md @@ -8,15 +8,51 @@ Every workflow touched by the tier redesign carries the header comment `CI tier policy: see .github/ci-policy.md`. Tuning the tiers means editing THIS table by PR — never ad-hoc pipeline changes. +## Merge requirement + +**Merge requirement: the basic-validation (PR) tier only. The full +suite runs on main and is NOT a merge gate.** + +In this repo the PR tier is named **basic**: job display names in +the check list carry the tier — PR-tier jobs are prefixed +`basic: ` (`basic: proxy port fallbacks`, `basic: spec parity`, +`basic: nix flake check ()`, `basic: go build`, ...), and +jobs that run only on main/nightly are prefixed +`full (main tier): `. One deliberate exception: the `id` +workflow's aggregator job keeps its historical status name +`nix flake check` — the required status context branch protection +has always used — while the matrix jobs under it carry the tier +prefix (the same exception opencode made for its branch-required +aggregator). + +**Formatting is not a merge gate.** No treefmt/format context is +in the basic tier or the required checks. Formatting is +auto-fixed on main instead: the `auto-format` workflow +(`.github/workflows/auto-format.yml`) runs treefmt on every +push to main (plus a nightly sweep) and commits any fixes +directly to main as the github-actions bot +(`style(treefmt): auto-format on main`). The fix lands within +seconds of the merge that introduced the drift — well before +the main-tier full check would file a breakage for it. + +Workflow names (`nix ci`, `id`, `mcpx`, `mcpx conformance`, +`mcpx nix build`, `go modules build`, `identity build`, +`map build`, `id bench`) are deliberately NOT renamed: +`main-broken.yml` (the Phase 3 watcher) and `jules.yml` reference +them by name in their `workflow_run` triggers. If branch rules +ever require checks by name, require the `basic`-prefixed names +(plus `nix flake check` for `id`) — full main-tier jobs must +never become merge requirements. + ## Change classes (§3.3 of the design) -| class | trigger paths (examples) | PR tier | -|---|---|---| -| 0 — prose | `**.md`, docs/, comments-only changes | nothing, or markdown lint only | -| 1 — config/data | `**.json/yaml/toml` non-build, `.github/**` (non-workflow) | syntax parse + lint of changed files | -| 2 — package source (default) | one package's src + tests | lint/format + typecheck/syntax of affected packages + affected unit tests | -| 3 — elevated | lockfiles, `go.mod`/`go.sum` roots, `flake.nix`/`flake.lock`, build definitions (`package.nix`), `.github/workflows/**`, shared/core libraries | class 2 + compile check of affected packages | -| 4 — nix expressions | `**.nix` | class 1 + parse/eval of the changed files only (never full flake check on a PR) | +| class | trigger paths (examples) | PR tier | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| 0 — prose | `**.md`, docs/, comments-only changes | nothing, or markdown lint only | +| 1 — config/data | `**.json/yaml/toml` non-build, `.github/**` (non-workflow) | syntax parse + lint of changed files | +| 2 — package source (default) | one package's src + tests | lint/format + typecheck/syntax of affected packages + affected unit tests | +| 3 — elevated | lockfiles, `go.mod`/`go.sum` roots, `flake.nix`/`flake.lock`, build definitions (`package.nix`), `.github/workflows/**`, shared/core libraries | class 2 + compile check of affected packages | +| 4 — nix expressions | `**.nix` | class 1 + parse/eval of the changed files only (never full flake check on a PR) | Default when a change spans classes: the highest class wins. The policy ships conservative (more class 3) and loosens as the @@ -24,14 +60,14 @@ main-breakage rate (issues labelled `main-broken`) proves out. ## Tier assignment in this repo (after #1781) -| workflow | PR tier | main tier | nightly | -|---|---|---|---| -| nix ci | treefmt/format gate only | treefmt + full flake-check | schedule in nix-ci.yml | -| id | guard + affected-crate matrix (`id-pr-checks.txt`) | + full `nix flake check ./pkgs/id` job | schedule in id-check.yml + id-e2e-nightly.yml (full flake check) | -| mcpx conformance | spec-parity leg only (measured 28s exec, run 40801660942, 2026-10-29 — under the 5m fast-leg limit) | all conformance legs + records + spec-parity | — (main covers it) | -| id bench | — (removed) | yes | — | -| go modules build / identity build / map build / mcpx nix build | class-3 paths only (see each workflow) | always (push to main, no path filter) | — | -| mcpx, lab-ops-hub, mod-tidy, research-workflow | unchanged path-gated PR checks (already PR-tier weight) | push to main | — | +| workflow | PR tier | main tier | nightly | +| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| nix ci | proxy port fallbacks only | full flake-check (formatting auto-fixed on main by the auto-format workflow) | schedule in nix-ci.yml | +| id | guard + affected-crate matrix (`id-pr-checks.txt`) | + full `nix flake check ./pkgs/id` job | schedule in id-check.yml + id-e2e-nightly.yml (full flake check) | +| mcpx conformance | spec-parity leg only (measured 28s exec, run 40801660942, 2026-10-29 — under the 5m fast-leg limit) | all conformance legs + records + spec-parity | — (main covers it) | +| id bench | — (removed) | yes | — | +| go modules build / identity build / map build / mcpx nix build | class-3 paths only (see each workflow) | always (push to main, no path filter) | — | +| mcpx, lab-ops-hub, mod-tidy, research-workflow | unchanged path-gated PR checks (already PR-tier weight) | push to main | — | ## Coverage rule @@ -57,5 +93,17 @@ push-to-main, by `github.ref` otherwise, `cancel-in-progress: true` — PR/branch runs cancel on supersede; main runs are never cancelled. Exceptions: `jules.yml` (load-bearing cip=false, #304) and scheduled singleton/deploy workflows (cip=false) are NOT -touched. Issue-event workflows (auto-assign) use a per-issue group -so cancel-in-progress can only supersede a run for the same issue. +touched. Issue/PR management is NOT event-triggered: `repo-sweeper.yml` +runs every 15 minutes (`*/15 * * * *`, one live run: group +`repo-sweeper`, `cancel-in-progress: true` — safe because the +sweeper is schedule/dispatch-only) and performs the management +duties in one deterministic pass. It replaced `auto-assign.yml` +(assign the maintainer to open issues/PRs). Kept event-based, +deliberately: `jules.yml` — a human applies the `jules` label +and waits for Jules to start, and its `workflow_run` leg is +the ci-failure-fix remediation chain (#304); a synchronous +human-initiated handoff, not management bookkeeping. Never +pair `queue: max` with a cancel-in-progress expression that +can evaluate true for `issues`/`pull_request_target` events +(a GitHub validation error, openchamber#84) — the sweeper +stays schedule-only for this reason. diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml deleted file mode 100755 index 0527d0e46e..0000000000 --- a/.github/workflows/auto-assign.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Auto Assign -on: - issues: - types: [opened] - pull_request_target: - types: [opened, reopened, synchronize] -concurrency: - # Keyed by the target, not github.ref: for issues and pull_request_target - # events github.ref is always the default/base branch, so a ref-keyed group - # is one repo-wide group and a burst of opened events silently replaces the - # pending run (queue: single is the default), dropping its assignment (#302). - # The group below is per-target, so cancel-in-progress only ever supersedes - # a stale run for the SAME issue/PR; the assignment is idempotent and the - # newest event wins (Phase 1, #1780). CI tier policy: see .github/ci-policy.md - group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - run: - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - issues: write - pull-requests: write - steps: - - name: Assign to maintainer - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - GH_EVENT_NAME: ${{ github.event_name }} - GH_ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} - run: | - if [[ "$GH_EVENT_NAME" == "pull_request_target" ]]; then - gh pr edit "$GH_ISSUE_NUMBER" --add-assignee dezren39 --repo "$GH_REPO" - else - gh issue edit "$GH_ISSUE_NUMBER" --add-assignee dezren39 --repo "$GH_REPO" - fi diff --git a/.github/workflows/auto-format.yml b/.github/workflows/auto-format.yml new file mode 100644 index 0000000000..4f3cd4a99f --- /dev/null +++ b/.github/workflows/auto-format.yml @@ -0,0 +1,92 @@ +name: auto-format + +# CI tier policy: see .github/ci-policy.md — formatting is mechanical +# and NEVER gates a merge: no treefmt/format context is in the basic +# tier or the required checks. Instead this workflow runs treefmt on +# every push to main (plus a nightly sweep) and commits any fixes +# directly to main as the github-actions bot. The fix lands within +# seconds of the merge that introduced the drift — well before the +# main-tier full check would file a breakage for it. +# +# Loop safety, two layers: +# 1. Pushes made with GITHUB_TOKEN do not trigger workflow runs at +# all (GitHub suppresses them), so the bot's own fix commit +# cannot retrigger this workflow. +# 2. If the token is ever swapped for a PAT/App token, the job +# below still skips any push whose head commit is the bot's own +# format commit. + +on: + push: + branches: [main] + schedule: + # Nightly sweep over the last day's changed files. + - cron: "47 6 * * *" + workflow_dispatch: + +permissions: + contents: write + +# One format pass at a time on main; a pass is never cancelled +# mid-commit. +concurrency: + group: auto-format-main + cancel-in-progress: false + +jobs: + treefmt: + name: treefmt auto-format + if: ${{ github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'style(treefmt):') }} + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 + + - name: Format changed files with treefmt and commit any fixes + env: + BEFORE_SHA: ${{ github.event.before }} + run: | + set -euo pipefail + changed_file="$(mktemp)" + trap 'rm -f "$changed_file"' EXIT + if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then + git log --since="25 hours ago" --pretty=format: --name-only \ + | sort -u | while IFS= read -r f; do + [[ -n "$f" && -f "$f" ]] && printf '%s\n' "$f" + done > "$changed_file" + else + base_sha="$BEFORE_SHA" + if [[ -z "$base_sha" || "$base_sha" =~ ^0+$ ]]; then + base_sha="$(git rev-parse HEAD^)" + fi + git diff --name-only --diff-filter=ACMR "$base_sha...$GITHUB_SHA" > "$changed_file" + fi + mapfile -t changed_files < "$changed_file" + if ((${#changed_files[@]} == 0)); then + echo "No changed files to format." + exit 0 + fi + printf 'Formatting %s file(s):\n' "${#changed_files[@]}" + printf ' %s\n' "${changed_files[@]}" + nix run .#format -- "${changed_files[@]}" + if git diff --quiet; then + echo "treefmt made no changes." + exit 0 + fi + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "style(treefmt): auto-format on main" + for attempt in 1 2; do + if git push origin HEAD:main; then + echo "Pushed auto-format commit." + exit 0 + fi + echo "Push raced a newer main; rebasing (attempt $attempt)." + git pull --rebase origin main + done + git push origin HEAD:main diff --git a/.github/workflows/go-modules-build.yml b/.github/workflows/go-modules-build.yml index 4ed4b1311a..acc4707715 100644 --- a/.github/workflows/go-modules-build.yml +++ b/.github/workflows/go-modules-build.yml @@ -75,7 +75,7 @@ concurrency: jobs: build: - name: go build (${{ matrix.module }}) + name: "basic: go build (${{ matrix.module }})" runs-on: ubuntu-latest timeout-minutes: 15 strategy: diff --git a/.github/workflows/id-bench.yml b/.github/workflows/id-bench.yml index d5879f8044..10b4d062f4 100644 --- a/.github/workflows/id-bench.yml +++ b/.github/workflows/id-bench.yml @@ -40,7 +40,7 @@ concurrency: jobs: bench: - name: benchmark regression report + name: "full (main tier): benchmark regression report" runs-on: ubuntu-latest timeout-minutes: 60 steps: diff --git a/.github/workflows/id-check.yml b/.github/workflows/id-check.yml index f9bdd2a720..dc6b86fd58 100644 --- a/.github/workflows/id-check.yml +++ b/.github/workflows/id-check.yml @@ -82,7 +82,7 @@ jobs: # JSON array for the matrix. The list file stays the single source of # truth: adding a check to id-pr-checks.txt adds a parallel job. guard: - name: guard PR check list + name: "basic: guard PR check list" runs-on: ubuntu-latest timeout-minutes: 10 outputs: @@ -124,7 +124,7 @@ jobs: # derivation. check-id-pr-checks.sh holds the exclusion list and keeps # this list in sync with pkgs/id/flake.nix. check_each: - name: nix flake check (${{ matrix.check }}) + name: "basic: nix flake check (${{ matrix.check }})" needs: guard runs-on: ubuntu-latest timeout-minutes: 30 @@ -181,7 +181,7 @@ jobs: # backstop. Nothing from the old PR matrix is lost: the union of this # job, id-e2e-nightly, and the PR matrix covers it. full-flake-check: - name: nix flake check (full, main tier) + name: "full (main tier): nix flake check" if: github.event_name != 'pull_request' runs-on: ubuntu-latest timeout-minutes: 180 diff --git a/.github/workflows/identity-build.yml b/.github/workflows/identity-build.yml index 0abcde730e..fb469a6924 100644 --- a/.github/workflows/identity-build.yml +++ b/.github/workflows/identity-build.yml @@ -43,7 +43,7 @@ concurrency: jobs: build: - name: go build (${{ matrix.tags }}) + name: "basic: go build (${{ matrix.tags }})" runs-on: ubuntu-latest timeout-minutes: 15 strategy: diff --git a/.github/workflows/lab-ops-hub.yml b/.github/workflows/lab-ops-hub.yml index d1e857b547..0088f56289 100644 --- a/.github/workflows/lab-ops-hub.yml +++ b/.github/workflows/lab-ops-hub.yml @@ -44,7 +44,7 @@ concurrency: jobs: test: - name: test + name: "basic: test" runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/.github/workflows/map-build.yml b/.github/workflows/map-build.yml index a2a37b4034..ad9e7c395b 100644 --- a/.github/workflows/map-build.yml +++ b/.github/workflows/map-build.yml @@ -43,7 +43,7 @@ concurrency: jobs: build: - name: go build + name: "basic: go build" runs-on: ubuntu-latest timeout-minutes: 15 steps: diff --git a/.github/workflows/mcpx-conformance.yml b/.github/workflows/mcpx-conformance.yml index fd679efd59..253bb25d50 100644 --- a/.github/workflows/mcpx-conformance.yml +++ b/.github/workflows/mcpx-conformance.yml @@ -55,7 +55,7 @@ env: jobs: leg: - name: ${{ matrix.leg }} + name: "full (main tier): ${{ matrix.leg }}" # Main tier only (Phase 2, #1781): the conformance legs move off PRs. # The spec-parity job below stays on PRs: measured exec 28s on run # 40801660942 (2026-10-29), well under the 5m fast-leg limit. @@ -265,7 +265,7 @@ jobs: fi spec-parity: - name: spec parity + name: "basic: spec parity" # Which MCP revisions mcpx supports against which the conformance suite # knows, read from each tool itself. See scripts/spec-parity.py for the # deadlines; the variables are written on main only. @@ -347,7 +347,7 @@ jobs: esac records: - name: compare with the records + name: "full (main tier): compare with the records" needs: leg if: always() && github.event_name != 'pull_request' runs-on: ubuntu-latest diff --git a/.github/workflows/mcpx-nixbuild.yml b/.github/workflows/mcpx-nixbuild.yml index 68ab837ecf..da6dccb796 100644 --- a/.github/workflows/mcpx-nixbuild.yml +++ b/.github/workflows/mcpx-nixbuild.yml @@ -49,7 +49,7 @@ concurrency: jobs: nix-build: - name: nix build + name: "basic: nix build" runs-on: ubuntu-latest timeout-minutes: 30 steps: diff --git a/.github/workflows/mcpx.yml b/.github/workflows/mcpx.yml index 13eb372ae5..1aa5f2fcd9 100644 --- a/.github/workflows/mcpx.yml +++ b/.github/workflows/mcpx.yml @@ -56,6 +56,7 @@ permissions: jobs: test: + name: "basic: test" runs-on: ubuntu-latest timeout-minutes: 30 steps: diff --git a/.github/workflows/mod-tidy.yml b/.github/workflows/mod-tidy.yml index 2f0f02c4ec..8af54985f1 100644 --- a/.github/workflows/mod-tidy.yml +++ b/.github/workflows/mod-tidy.yml @@ -28,7 +28,7 @@ permissions: jobs: tidy: - name: Go module tidy + name: "basic: Go module tidy" runs-on: ubuntu-latest timeout-minutes: 15 steps: diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index 3570190afd..e592e5e388 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -26,44 +26,28 @@ concurrency: cancel-in-progress: true jobs: - treefmt: - name: treefmt check + # Basic tier: the proxy ports' fallback copies (bin/*.mjs script + # defaults and the {env:VAR:-port} defaults in + # .opencode/opencode.jsonc) must match the single definitions in + # home/common/default.nix, or a non-shell launch silently dials + # the wrong — or an empty — port (#434, #435). Pure bash/grep: no + # Nix needed, runs on every PR. This job used to also run the + # treefmt format check; formatting is no longer a merge gate — + # it is auto-fixed on main by .github/workflows/auto-format.yml + # (see .github/ci-policy.md). + proxy-port-fallbacks: + name: "basic: proxy port fallbacks" runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 5 steps: - uses: actions/checkout@v7 - with: - fetch-depth: 0 - # The proxy ports' fallback copies (bin/*.mjs script defaults and - # the {env:VAR:-port} defaults in .opencode/opencode.jsonc) must - # match the single definitions in home/common/default.nix, or a - # non-shell launch silently dials the wrong — or an empty — port - # (#434, #435). Pure bash/grep: no Nix needed. - name: Check proxy port fallbacks match their definitions run: .github/scripts/check-proxy-port-fallbacks.sh - - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 - - name: Check formatting for changed files - env: - BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - run: | - set -euo pipefail - base_sha="$BASE_SHA" - if [[ "$base_sha" =~ ^0+$ ]]; then - base_sha="$(git rev-parse HEAD^)" - fi - changed_files_file="$(mktemp)" - trap 'rm -f "$changed_files_file"' EXIT - git diff --name-only --diff-filter=ACMR -z "$base_sha...$GITHUB_SHA" > "$changed_files_file" - mapfile -d '' changed_files < "$changed_files_file" - if ((${#changed_files[@]} == 0)); then - echo "No changed files to format-check." - exit 0 - fi - nix run .#format-check -- "${changed_files[@]}" flake-check: - name: Nix flake evaluation - # Main tier only (Phase 2, #1781): PRs keep the treefmt/format gate above. + name: "full (main tier): Nix flake evaluation" + # Main tier only (Phase 2, #1781): PRs keep the basic proxy-port + # fallback check above; formatting is auto-fixed on main, never a gate. if: github.event_name != 'pull_request' runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/.github/workflows/repo-sweeper.yml b/.github/workflows/repo-sweeper.yml new file mode 100644 index 0000000000..2d9cd405fb --- /dev/null +++ b/.github/workflows/repo-sweeper.yml @@ -0,0 +1,78 @@ +name: repo sweeper + +# CI tier policy: see .github/ci-policy.md (fleet design #1779; +# event-bot consolidation, Drew directive 2026-10-29). +# +# This ONE scheduled workflow replaces the event-triggered +# auto-assign.yml, deleted in the same change. Auto Assign fired on +# every issues / pull_request_target opened event (and PR reopened / +# synchronize) just to assign the maintainer — bookkeeping nobody +# waits on synchronously, so it runs here instead as one +# deterministic pass every 15 minutes: every open issue and PR that +# lacks the maintainer assignee gets it. Worst-case assignment +# latency is now ~15 minutes instead of seconds; the accepted +# trade-off, and the same consolidation opencode and openchamber +# made with their repo-sweeper.yml. +# +# Audit of this repo's other event-triggered workflows (2026-10-29): +# nothing else is event-based issue/PR management. Kept event-based, +# deliberately NOT folded in: jules.yml — a human applies the +# `jules` label and waits for Jules to start work, and its +# workflow_run leg is the ci-failure-fix remediation chain (#304); +# a synchronous human-initiated handoff, not bookkeeping. +# main-broken.yml is workflow_run-triggered (the Phase 3 watcher), +# not issue management. Everything else is a pull_request/push +# validation check, a schedule, or a release workflow. +# +# Schedule/dispatch only: never add issues or pull_request_target +# triggers here. Pairing queue/cancel expressions with those events +# is a GitHub validation hazard (openchamber#84); the fixed +# cancel-in-progress below is safe only because this workflow has +# no such triggers. + +on: + schedule: + - cron: "*/15 * * * *" + workflow_dispatch: + +# Exactly one live sweeper run: a new tick cancels a still-running +# previous sweep (the pass is an idempotent assignee sync). +concurrency: + group: repo-sweeper + cancel-in-progress: true + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + sweep: + name: repo sweep + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Assign maintainer to open issues and PRs (absorbed Auto Assign) + uses: actions/github-script@v7 + with: + script: | + const owner = context.repo.owner; + const repo = context.repo.repo; + const maintainer = 'dezren39'; + // listForRepo returns issues and PRs together (a PR item + // carries a pull_request link). This reproduces Auto + // Assign's end state without the per-event fan-out: + // every open issue/PR assigned to the maintainer. + const items = await github.paginate(github.rest.issues.listForRepo, { + owner, repo, state: 'open', per_page: 100, + }); + let assigned = 0; + for (const item of items) { + if (item.assignees.some((a) => a.login === maintainer)) continue; + await github.rest.issues.addAssignees({ + owner, repo, issue_number: item.number, assignees: [maintainer], + }); + assigned += 1; + core.info(`Assigned ${maintainer} to #${item.number}`); + } + core.info(`Swept ${items.length} open issue(s)/PR(s); assigned ${assigned}.`); diff --git a/.github/workflows/research-workflow.yml b/.github/workflows/research-workflow.yml index 35b80bc22d..8ffb05df44 100644 --- a/.github/workflows/research-workflow.yml +++ b/.github/workflows/research-workflow.yml @@ -54,6 +54,7 @@ concurrency: jobs: workflow-contract: + name: "basic: workflow-contract (${{ matrix.python-version }})" runs-on: ubuntu-latest timeout-minutes: 15 strategy: diff --git a/lib/default.nix b/lib/default.nix index b783864f4c..c0b2d9b4f4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -679,12 +679,30 @@ let --fail-on-change \ "$@" ''; + # Write-mode twin of format-check, for the auto-format + # workflow (.github/workflows/auto-format.yml): same + # treefmt invocation without --fail-on-change. + format = pkgs.writeShellScriptBin "format" '' + export PATH="${pkgs.lib.makeBinPath fmtBins}:$PATH" + if [ "$#" -eq 0 ]; then + echo "usage: nix run .#format -- ..." >&2 + exit 2 + fi + exec treefmt \ + --config-file "$PWD/treefmt.toml" \ + --tree-root "$PWD" \ + "$@" + ''; in { apps.format-check = { type = "app"; program = "${formatCheck}/bin/format-check"; }; + apps.format = { + type = "app"; + program = "${format}/bin/format"; + }; formatter = pkgs.writeShellScriptBin "formatter" '' export PATH="${pkgs.lib.makeBinPath fmtBins}:$PATH"