Hamburger Cross Icon
Dr Exercise Required Sections
+
DR Documentation Collector

Dr Exercise Required Sections + DR Documentation Collector

Guardrail Collector Stable Operational Readiness

Enforce Dr Exercise Required Sections using data collected by DR Documentation Collector. Automatically check operational readiness standards on every PR.

Guardrail: Ensures the most recent DR exercise record contains required section headings documenting what was tested and the outcomes. Configurable via the exercise_required_sections input.
Data Source: Parse disaster recovery plan and exercise documentation to extract RTO/RPO targets, exercise dates, review timestamps, and section headings. Verify that teams document and regularly practice recovery procedures.

How DR Documentation Collector Powers This Guardrail

The DR Documentation Collector gathers metadata from your documentation systems. This data flows into Lunar's Component JSON, where the Dr Exercise Required Sections guardrail evaluates it against your standards.

When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.

1
DR Documentation Collector Gathers Data Collector
Extracts metadata from code, configs, and tool outputs
2
{ } Component JSON
Data centralized in structured format for evaluation
3
Dr Exercise Required Sections Checks Guardrail
Pass/fail result with actionable feedback in PRs

Quick Start Configuration

Add both the collector and policy to your lunar-config.yml to enable this guardrail.

📄 lunar-config.yml
# Step 1: Enable the DR Documentation Collector
collectors:
  - uses: github://earthly/lunar-lib/collectors/dr-docs@v1.0.0
    # with: ...

# Step 2: Enable the Compliance Documentation Guardrails
policies:
  - uses: github://earthly/lunar-lib/policies/compliance-docs@v1.0.0
    include: [dr-exercise-required-sections]
    # with: ...

What DR Documentation Collector Collects

This collector gathers the following data that the Dr Exercise Required Sections guardrail evaluates.

Collector code

dr-plan

Collects the disaster recovery plan document (default: docs/dr-plan.md). Expects YAML frontmatter with recovery objectives (rto_minutes, rpo_minutes), review metadata (last_reviewed, approver), and a Markdown body with sections covering recovery procedures.

Collector code

dr-exercise

Collects DR exercise records from a directory (default: docs/dr-exercises/). Each exercise is a date-prefixed Markdown file (e.g., 2025-11-15.md or 2025-11-15-database-failover.md) with optional YAML frontmatter for exercise type and body sections documenting the scenario and outcomes. Provides full exercise history and summary metrics.

Example Data Flow

Here's an example of the data that DR Documentation Collector writes to the Component JSON, which Dr Exercise Required Sections then evaluates.

{ } component.json From DR Documentation Collector
{
  "oncall": {
    "disaster_recovery": {
      "plan": {
        "exists": true,
        "path": "docs/dr-plan.md",
        "rto_defined": true,
        "rto_minutes": 60,
        "rpo_defined": true,
        "rpo_minutes": 15,
        "last_reviewed": "2025-12-01",
        "approver": "jane.doe@company.com",
        "sections": [
          "Overview",
          "Recovery Steps",
          "Contact List",
          "Dependencies"
        ]
      },
      "exercises": [
        {
          "date": "2025-11-15",
          "path": "docs/dr-exercises/2025-11-15.md",
          "exercise_type": "tabletop",
          "sections": [
            "Scenario",
            "Recovery Steps Tested",
            "Participants",
            "Action Items",
            "Lessons Learned"
          ]
        },
        {
          "date": "2025-05-20",
          "path": "docs/dr-exercises/2025-05-20.md",
          "exercise_type": "failover",
          "sections": [
            "Scenario",
            "Recovery Steps Tested",
            "Participants"
          ]
        }
      ],
      "latest_exercise_date": "2025-11-15",
      "exercise_count": 2
    }
  }
}

Configuration Options

DR Documentation Collector Inputs

Input Required Default Description
plan_paths Optional docs/dr-plan.md Comma-separated list of candidate paths to the DR plan document (first match wins)
exercise_dir_paths Optional docs/dr-exercises Comma-separated list of candidate directories for DR exercise records (first match wins)

Compliance Documentation Guardrails Inputs

Input Required Default Description
max_days_since_exercise Optional 365 Maximum number of days allowed since the last DR exercise
plan_required_sections Optional Overview,Recovery Steps,Contact List Comma-separated list of required sections in the DR plan
exercise_required_sections Optional Scenario,Recovery Steps Tested,Participants Comma-separated list of required sections in the DR exercise record
exercises_check_all Optional false Check required sections on all exercises (true) or only the latest (false)

Ready to Automate Your Standards?

See how Lunar can turn your engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check Infrastructure conventions
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Turn any process doc into guardrails
Book a Demo