# Change-Impact QA Dimensions — starter template.
#
# To ACTIVATE the change-impact checklist, copy this file to:
#   .claude/cabinet/qa-dimensions.yaml
# and customize the dimensions for your project. The /execute
# post-impl-checklist phase looks for `qa-dimensions.yaml` (no
# `-template` suffix) and stays silent until that file exists.
#
# How it works: after implementation, the phase reads the git diff,
# matches each changed file against every dimension's `paths` globs,
# and surfaces the matched dimensions' checks as context for the
# pre-commit cabinet sweep (Checkpoint 3). QA is the primary consumer.
#
# The checklist learns in both directions: /debrief's checklist-feedback
# phase ADDS checks when bugs slip through, and /audit's
# checklist-pruning phase surfaces low-hit-rate dimensions for
# human-approved REMOVAL (evidence lives in checklist-stats.json — see
# cabinet/checklist-stats-schema.md; runtime state never lives in this
# file).
#
# ── Schema ────────────────────────────────────────────────────────
# dimensions:                  # top-level map; keys are dimension names
#   <dimension-name>:
#     paths:                   # list of glob patterns (REQUIRED, >=1)
#       - "glob/pattern/**"
#     severity: high           # high | moderate | info (REQUIRED)
#     checks:                  # list of checks (REQUIRED, >=1)
#       - tag: run            # run | review
#         check: "text"        # what to verify
#
# ── Glob matching rules (canonical — the phase follows these) ───────
#   * A leading "./" is stripped from both pattern and path before
#     matching. Diff paths are repo-relative with no "./".
#   * "*" matches within ONE path segment (no "/"). "src/api/*"
#     matches "src/api/foo.js" but NOT "src/api/v2/foo.js".
#   * "**" matches across segments (subtree). "src/api/**" matches
#     "src/api/foo.js" AND "src/api/v2/foo.js".
#   * A trailing "/" means "this directory and below": "src/api/" is
#     treated as "src/api/**".
#   * A bare extension glob like "*.md" is UNROOTED — it matches that
#     extension at any depth. For root-only, use an explicit prefix:
#     "README.md" or "docs/*.md" instead of bare "*.md".
#
# ── severity meanings ───────────────────────────────────────────────
#   high     — a miss here ships a real bug; sweep should treat as blocking
#   moderate — worth checking; sweep treats as advisory
#   info     — reminder/nudge; never blocking
#
# The examples below are illustrative. Delete or replace them.

dimensions:
  # ── Replace the example paths below with your project's real paths. ──
  # The dimension *concepts* are broadly useful; the glob patterns are
  # placeholders. Run /checklist-discover to auto-detect your project's
  # paths and generate a tailored qa-dimensions.yaml.

  data-coherence:
    paths:
      - "**/*schema*"
      - "**/*migration*"
      - "**/*.sql"
      - "**/models/**"
    severity: high
    checks:
      - tag: run
        check: "Run schema validation if any schema or migration file changed."
      - tag: review
        check: "Verify referential integrity for any new foreign keys or cross-store references."
      - tag: review
        check: "Confirm any migration handles existing rows, not just fresh installs."

  api-drift:
    paths:
      - "**/routes*"
      - "**/api/**"
      - "src/**"
      - "**/index.mjs"
    severity: high
    checks:
      - tag: run
        check: "Grep the changed files for exported symbols; confirm the public surface is intentional."
      - tag: review
        check: "Check downstream consumers of any changed or removed export."

  test-staleness:
    paths:
      - "**/test*/**"
      - "**/*.test.*"
      - "**/*.spec.*"
      - "**/factories/**"
      - "**/fixtures/**"
    severity: high
    checks:
      - tag: run
        check: "Run the test suite if any test, factory, or fixture file changed."
      - tag: review
        check: "If a model's validations or associations changed, verify factories still produce valid records."
      - tag: review
        check: "If behavior changed, check whether existing specs assert on the old behavior."

  knowledge-layer:
    paths:
      - "**/docs/**"
      - "**/*guide*"
      - "**/README*"
      - "**/CHANGELOG*"
    severity: moderate
    checks:
      - tag: review
        check: "If user-facing behavior or vocabulary changed, check whether docs or guides need updating."
