Files
mac_without_borders/tools/gates.sh
T
lucioandClaude Fable 5.1 87aeee6f93 Adopt the user's development rule: one lane at a time, no test suites
CLAUDE.md gains a 'How this project is developed' section: strictly
serial Dev (Opus 5) -> QA (Sonnet 5, code quality) -> lead inspection;
commit along the way without requiring every commit to compile; the
user is the tester. docs/loop.md, docs/topo.md and TODO.md are
rewritten to a serial lane order with no test-writing items; the test
targets are removed and tools/gates.sh is lint + layering grep + build.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-15 23:55:41 -07:00

26 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# The definition of "done" for a lane's final commit (CLAUDE.md, Swift
# standards). No test suites by the user's instruction — the user tests.
# 1. swift-format lint --strict is clean
# 2. MWBCore imports only Foundation / CommonCrypto / CryptoKit (README D2)
# 3. swift build with warnings as errors is clean
# Exit 0 only if all pass. Operates on the repo containing this script,
# so it works inside a lane worktree.
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
cd "$root"
echo "== gate 1/3: swift-format lint --strict"
xcrun swift-format lint --strict --recursive Sources Package.swift
echo "== gate 2/3: MWBCore layering"
if grep -rnE '^\s*import (AppKit|Cocoa|CoreGraphics|Carbon|SwiftUI|Network|IOKit|ApplicationServices)\b' Sources/MWBCore; then
echo "gates: MWBCore may import only Foundation, CommonCrypto and CryptoKit (README D2)" >&2
exit 1
fi
echo "== gate 3/3: swift build -Xswiftc -warnings-as-errors"
swift build -Xswiftc -warnings-as-errors 2>&1 | grep -v '^\[' || true
swift build -Xswiftc -warnings-as-errors >/dev/null
echo "== gates: all green"