From e2c169e1db47b89bd1c898d2ab6ac59866369f6f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 10 Jun 2026 06:32:56 +0000 Subject: [PATCH] ci: enforce lint and formatting, add warn-only layering guard Add a Lint & Format job (oxlint --deny-warnings + new format:check script) and a warn-only guard that flags imports of src/commands/* from src/daemon and src/platforms; the guard flips to a hard failure once shared contracts move out of the commands layer. https://claude.ai/code/session_01LXZXzxi55sZ11DSyqWyBA2 --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 38 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0995bd59..718e2793c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,43 @@ jobs: exit 1 fi + lint: + name: Lint & Format + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup toolchain + uses: ./.github/actions/setup-node-pnpm + + - name: Run oxlint + run: pnpm lint + + - name: Check formatting + run: pnpm format:check + + layering-guard: + name: Layering Guard (warn-only) + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Warn on commands/ imports below the CLI surface layer + run: | + # daemon/ and platforms/ should not depend on the CLI commands layer. + # Warn-only until the shared contracts move out of src/commands/; + # flip to a hard failure once existing imports are migrated. + matches=$(rg -n "from '.*commands/" src/daemon src/platforms --glob '!**/__tests__/**' --glob '!*.test.ts' || true) + if [ -n "$matches" ]; then + echo "$matches" + count=$(printf '%s\n' "$matches" | wc -l) + echo "::warning title=Layering drift::$count import(s) of src/commands/* from src/daemon or src/platforms. New code should depend on shared contracts instead." + fi + fallow: name: Fallow Code Quality runs-on: ubuntu-latest diff --git a/package.json b/package.json index 35e7e787f..47523e5d4 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "perf:android": "node --experimental-strip-types scripts/perf/run.ts --platform android", "lint": "oxlint . --deny-warnings", "format": "oxfmt --write src test skills package.json tsconfig.json tsconfig.lib.json rslib.config.ts vitest.config.ts .github/actions/setup-node-pnpm/action.yml .oxlintrc.json .oxfmtrc.json '!test/skillgym/.skillgym-results/**'", + "format:check": "oxfmt --check src test skills package.json tsconfig.json tsconfig.lib.json rslib.config.ts vitest.config.ts .github/actions/setup-node-pnpm/action.yml .oxlintrc.json .oxfmtrc.json '!test/skillgym/.skillgym-results/**'", "fallow": "fallow --summary", "fallow:baseline": "(fallow dead-code --save-baseline fallow-baselines/dead-code.json --summary || true) && (fallow health --save-baseline fallow-baselines/health.json --summary || true)", "check:fallow": "fallow audit",