Files
clawmates/ci/check-loc.sh
T
Omar SobhandClaude Fable 5 0afb359183 P0: workspace scaffold, CI gates, tc-domain, tc-config, tc-db vs real Postgres
- Cargo workspace with 1250-line and no-placeholder CI gates wired first
- tc-domain: id newtypes, SessionKey codec (proptest round-trip), Role,
  GatedCategory (spec §15), AccessPolicy, core entities
- tc-config: figment TOML+env config, DeployTarget/provider/auth selection
  with semantic validation
- migrations/0001: full spec §14 schema incl. DB-enforced append-only audit_log
- tc-db: compile-time-checked sqlx repos (workspaces, users, agents+policies,
  credits, audit) with committed .sqlx offline metadata
- tc-testkit: per-test real-Postgres databases (testcontainers or
  TC_TEST_DATABASE_URL), embedded migrations

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-09 22:25:47 -05:00

29 lines
913 B
Bash
Executable File

#!/usr/bin/env bash
# Fails the build if any source file exceeds the 1,250-line budget.
# Warns for files over the 900-line soft threshold so splits happen
# before they hurt.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
HARD_LIMIT=1250
SOFT_LIMIT=900
STATUS=0
# Source extensions under budget. Generated/vendored paths are excluded.
while IFS= read -r f; do
[ -z "$f" ] && continue
lines=$(wc -l <"$f" | tr -d ' ')
if [ "$lines" -gt "$HARD_LIMIT" ]; then
echo "FAIL: $f has $lines lines (limit $HARD_LIMIT)"
STATUS=1
elif [ "$lines" -gt "$SOFT_LIMIT" ]; then
echo "WARN: $f has $lines lines (soft limit $SOFT_LIMIT)"
fi
done < <(
find "$ROOT/crates" "$ROOT/frontend/src" "$ROOT/tools" "$ROOT/tests" \
-type f \( -name '*.rs' -o -name '*.ts' -o -name '*.tsx' -o -name '*.css' \) \
-not -path '*/node_modules/*' -not -path '*/target/*' 2>/dev/null
)
exit "$STATUS"