$schema: "@gobing-ai/spur/schemas/rule-file.schema.json"
# Coverage gate — per-file line coverage meets threshold from Bun's lcov output.
# Absorbed from ts-libs/.spur/rules/quality/coverage-gate.yaml, re-scoped to
# Spur's monorepo layout:
#   - lcovPath kept at .coverage/lcov.info (Spur's `bun run test:coverage` —
#     what `bun run check` and the `*:full` chains run — writes coverage there
#     via --coverage-dir=.coverage; plain `bun run test` skips coverage)
#   - include expanded to apps/** + packages/** (Spur tests cover both;
#     ts-libs only covers packages/**)
#   - threshold kept at 90 matching bunfig.toml coverageThreshold
#   - no drizzle exclude needed (Spur doesn't vendor generated SQL in src/)
#
# Scope tightened to production source only. No per-file exclusions: every
# measured source file must meet the threshold. (Former vendors/stubs/schema/
# migrations/db exclusions were verified stale — all measured files pass 90%.)
rules:
  - id: coverage-gate
    description: "Per-file line coverage meets 90% threshold (read from lcov)"
    severity: error
    evaluator:
      type: coverage-gate
      config:
        lcovPath: .coverage/lcov.info
        threshold: 90
        include:
          - "apps/**/src/**"
          - "packages/**/src/**"
