Doctor: introduce YAML-driven allowlist for committed project files

What does this MR do and why?

Adds a YAML-driven allowlist to the ai-harness-doctor forbidden files check, so intentionally committed project content can be added without code changes.

This is a prerequisite for !232403 (merged), which commits .claude/skills/gitlab-coding-principles/SKILL.md as project content. Without this exception the doctor check would flag that file as a forbidden committed tool config file.

What changes

  • allowed_committed_files.yml (new): YAML file listing allowed prefix strings, each with a comment explaining the reason. Future exceptions can be added by appending here — no code changes required.
  • check_forbidden_files.rb: Replaces the ALLOWED_COMMITTED_PREFIXES hardcoded constant with a .allowed_prefixes class method that lazily loads and freezes the list from YAML at runtime.
  • SPECIFICATION/02_contracts.md: Updates §3.3 to describe the YAML mechanism and prefix-matching semantics.
  • SPECIFICATION/04_scenarios.md: Generalises the three allowlist scenarios to reference the YAML file rather than specific paths (integration spec stays concrete per reviewer request).
  • check_forbidden_files_spec.rb: Unit specs are now generic (described_class.allowed_prefixes.first), plus a new .allowed_prefixes describe block covering YAML loading.
  • integration_spec.rb: Keeps the concrete .claude/skills/gitlab-coding-principles/SKILL.md test.

Design rationale

  • The allowlist uses prefix matching (start_with?), supporting both exact-file paths and directory prefixes.
  • Each entry must be accompanied by a YAML comment documenting the reason. Adding new entries requires opening a small spec-driven MR (updating the YAML + integration spec + scenarios).
  • The allowlist is intentionally narrow: a single initial entry for the gitlab-coding-principles skill.

How to validate

# Doctor check (should pass)
scripts/ai_harness/doctor

# Unit and integration specs
bin/rspec spec/tooling/ai_harness/doctor/steps/perform_doctor_checks/check_forbidden_files_spec.rb
bin/rspec spec/tooling/ai_harness/doctor/integration_spec.rb

References

  • !232403 (merged) — the MR that commits the skill and depends on this exception
Edited by Pedro Pombeiro

Merge request reports

Loading
Loading