Hamburger Cross Icon
Lifecycle Set
+
Backstage Collector

Lifecycle Set + Backstage Collector

Guardrail Collector Beta Repository And Ownership

Enforce Lifecycle Set using data collected by Backstage Collector. Automatically check repository and ownership standards on every PR.

Guardrail: Validates that the lifecycle stage (spec.lifecycle) is defined in the catalog-info.yaml. Lifecycle stages (production, experimental, deprecated) inform operational expectations and SLO requirements. Fails if no catalog file is present.
Data Source: Parses and lints Backstage catalog-info.yaml files. Writes the raw Backstage descriptor (apiVersion, kind, metadata, spec) to .catalog.native.backstage, preserving annotations as-is.

How Backstage Collector Powers This Guardrail

The Backstage Collector gathers metadata from your service catalog systems. This data flows into Lunar's Component JSON, where the Lifecycle Set 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
Backstage Collector Gathers Data Collector
Extracts metadata from code, configs, and tool outputs
2
{ } Component JSON
Data centralized in structured format for evaluation
3
Lifecycle Set 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 Backstage Collector
collectors:
  - uses: github://earthly/lunar-lib/collectors/backstage@v1.0.5
    # with: ...

# Step 2: Enable the Backstage Guardrails
policies:
  - uses: github://earthly/lunar-lib/policies/backstage@v1.0.5
    include: [lifecycle-set]
    # with: ...

What Backstage Collector Collects

This collector gathers the following data that the Lifecycle Set guardrail evaluates.

Collector code

catalog-info

Scans the repository for a catalog-info.yaml file (configurable paths) and parses its contents as-is into .catalog.native.backstage (apiVersion, kind, metadata, spec). Annotations are preserved verbatim with their backstage.io/ or vendor prefixes. Lints the file for schema/syntax issues and writes any findings to .catalog.native.backstage.valid and .catalog.native.backstage.errors[].

Example Data Flow

Here's an example of the data that Backstage Collector writes to the Component JSON, which Lifecycle Set then evaluates.

{ } component.json From Backstage Collector
{
  "catalog": {
    "native": {
      "backstage": {
        "valid": true,
        "errors": [],
        "path": "catalog-info.yaml",
        "apiVersion": "backstage.io/v1alpha1",
        "kind": "Component",
        "metadata": {
          "name": "payment-api",
          "description": "Payment processing API",
          "annotations": {
            "backstage.io/techdocs-ref": "dir:.",
            "pagerduty.com/integration-key": "PXXXXXX",
            "grafana/dashboard-selector": "https://grafana.example.com/d/abc123",
            "backstage.io/source-location": "url:https://github.com/acme/payment-api"
          },
          "tags": ["payments", "api", "tier1"]
        },
        "spec": {
          "type": "service",
          "owner": "team-payments",
          "lifecycle": "production",
          "system": "payment-platform",
          "providesApis": ["payment-api"],
          "consumesApis": ["user-api", "notification-api"],
          "dependsOn": ["resource:database-payments", "resource:cache-redis"]
        }
      }
    }
  }
}

Configuration Options

Backstage Collector Inputs

Input Required Default Description
paths Optional catalog-info.yaml,catalog-info.yml Comma-separated list of catalog file paths to check (first match wins)

Ready to Automate Your Standards?

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

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo