> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sureops.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# services.yaml Reference

> Field-by-field reference for the sureops service catalog contract.

`services.yaml` is the customer-authoritative service catalog. Agents use it to know who owns each service, how it depends on other services, and where the runbook lives. Authoring it is optional in the sense that sureops will discover services from your telemetry without it — but if you've connected a knowledge base repo at all, `services.yaml` is a hard prerequisite for everything else in that repo: ingestion short-circuits with a "no contract" status when `services.yaml` is missing, so your runbooks are never even listed, let alone indexed, until it exists.

## Minimum viable contract

```yaml theme={null}
# .sureops/services.yaml
services:
  - name: payment
    git_repo: acme/payment
    owner: payments-team
    runbook: .sureops/runbooks/payment.md
    tags: [tier-1]
    depends_on: [checkout, currency]
```

Only `name` and `git_repo` are required. Everything else — including `owner`, `runbook`, `tags`, and `depends_on` above — is optional but recommended.

***

## Field reference

### Core fields

| Field | Required | Description |
| - | - | - |
| `name` | **yes** | Matches your OTel `resource.service.name`. Agents key everything off this value. Lowercase letters, digits, and hyphens; must start with a letter. |
| `git_repo` | **yes** | Where fix-PRs open, unless `source.repo` is set. Format: `<owner>/<repo>` only — no `github.com/` prefix, no extra path segments, no full URL. |
| `default_branch` | recommended | The base branch source-fix PRs are opened against. Defaults to `main` if omitted — set this explicitly if your default branch is something else (e.g. `master`, `develop`). A change takes effect for fix PRs on the next ingest. |
| `owner` | recommended | Team or individual who owns this service, declared by you. It's shown with the service in sureops; it isn't used for paging or routing today. There is no automatic derivation — if you omit it, `owners.team` is used when set; otherwise the service simply has no declared owner. |
| `runbook` | recommended | Repo-relative path to a Markdown file inside your knowledge base repo (e.g. `.sureops/runbooks/payment.md`). Your runbook file has to live under `.sureops/runbooks/` to be indexed as a runbook — see the note below. |
| `depends_on` | recommended | Flat list of service names this service calls. **Must be snake\_case** — `dependsOn` (camelCase) is not recognized: the parser logs an "unknown field" warning (same as `tier`/`type`/`lifecycle` below) and nothing reads the value. sureops also discovers dependencies from telemetry — your declaration overrides on conflict. |
| `description` | optional | Free text. Useful for agent grounding but not used for routing. |
| `tags` | optional | Free-form list of strings. Use this for a tier-like concept (e.g. `tags: [tier-1]`) or any other classification you want to track — sureops doesn't interpret tag values today, but they're retained and shown in the UI. |

`tier`, `type`, and `lifecycle` are **not recognized fields**. If you include them, the parser ignores them and logs an "unknown field" warning — it will not error, but nothing reads the values. Use `tags` for a tier-like concept instead.

> [!WARNING]
>
> `runbook:` only does something if it points at a file inside `.sureops/runbooks/` in your knowledge base repo. An external wiki URL (Confluence, Notion, an internal wiki) is stored as metadata but is **never fetched** — it produces zero grounding context for agents. If you want a runbook's content to actually inform diagnosis, the content has to live in your KB repo. See [Runbooks & Knowledge Base](https://docs.sureops.ai/your-rules/runbooks-and-knowledge-base.md).

***

### Extended fields (optional, additive)

These fields give agents richer context for fix-PR generation and blast-radius analysis. Teams with the simpler flat schema above continue to parse correctly — unknown nested keys produce warnings, not errors.

#### `identifiers` — cross-source aliases

Helps sureops match your contract entry with telemetry signals from different sources.

```yaml theme={null}
identifiers:
  otel_service_name: payments      # defaults to `name` if omitted
  k8s_label_selector: app.kubernetes.io/component=payments
  k8s_namespace: prod-payments
  k8s_deployment_name: payments-deployment
```

#### `image` — container image metadata

The image fields are stored for reference but not used today.

```yaml theme={null}
image:
  registry: ghcr.io
  repository_template: "acme/payments"
  default_tag: 1.0.0
  chart_value_path: components.payments.image
```

#### `source` — source code metadata

Used by the Fix PR Agent to locate the relevant code path.

```yaml theme={null}
source:
  repo: acme/payments-service    # WINS over top-level git_repo for the repository node's identity (and fix-PR routing) when both are set
  src_path: src/payments/
  language: go
```

> [!NOTE]
>
> `source.repo` takes precedence over `git_repo` when both are set — the repository node the Fix PR Agent routes against is keyed on `source.repo`, falling back to `git_repo` only when `source.repo` is absent. In practice, most services only set `git_repo`; only set `source.repo` too if the code the Fix PR Agent should target actually lives in a different repo than `git_repo` identifies.

#### `owners` — structured ownership

Richer ownership metadata, stored for reference. To choose who reviews sureops' PRs, set `reviewers` in [`policy.yaml`](https://docs.sureops.ai/your-rules/repo-layout#policyyaml).

```yaml theme={null}
owners:
  team: payments-team            # human-readable
  github_team: payments-oncall   # GitHub team slug
```

#### `deploy` — deployment mechanism

Stored for context; not yet used to choose how a fix is applied.

```yaml theme={null}
deploy:
  kind: helm                     # 'helm' | 'kustomize' | 'argocd-app' | 'cdk8s'
  component_path: components.payments
```

#### `health` — health-check metadata (opaque passthrough)

Your health-check shape varies by service (readiness/liveness probes, a single port+protocol, etc.), so sureops stores whatever you put here as-is on the service node without interpreting it. There's no fixed sub-schema — put whatever shape your tooling needs.

```yaml theme={null}
health:
  port: 8080
  path: /healthz
```

#### `chart` — top-level Helm chart path

Declared once at the top level of `services.yaml` (not per-service): the directory inside the source repo where the Helm chart lives. sureops uses it when validating fixes that change chart values. Per-service `deploy.component_path` is stored for reference.

```yaml theme={null}
chart:
  path: deploy/helm/acme-chart
```

***

## Complete example

```yaml theme={null}
# .sureops/services.yaml
version: 1

chart:
  path: deploy/helm/acme-chart

services:
  - name: payments
    git_repo: acme/payments-service
    default_branch: main
    owner: payments-team
    runbook: .sureops/runbooks/payments.md
    tags: [tier-1]
    description: "Customer payment processing service"
    depends_on: [auth, inventory]

    identifiers:
      otel_service_name: payments
      k8s_namespace: prod-payments
      k8s_deployment_name: payments-deployment

    image:
      registry: ghcr.io
      repository_template: "acme/payments"
      default_tag: 1.0.0

    source:
      src_path: src/payments/
      language: go

    owners:
      team: payments-team
      github_team: payments-oncall

    deploy:
      kind: helm
      component_path: components.payments

  - name: auth
    git_repo: acme/auth
    owner: platform-team
    runbook: .sureops/runbooks/auth.md
    tags: [tier-1]
    depends_on: [users-db]

  - name: inventory
    git_repo: acme/inventory
    owner: catalog-team
    runbook: .sureops/runbooks/inventory.md
    tags: [tier-2]
    depends_on: [products-db]
```

***

## Ownership is customer-declared only

There is no automatic ownership derivation today. If you omit `owner` for a service, sureops uses `owners.team` when you've set it; otherwise that service simply has no declared owner in the landscape graph — sureops does not read your CODEOWNERS file to infer one. (A CODEOWNERS-derived `owner` is a plausible future addition, but it isn't implemented, and no agent or UI path relies on it.)

If you want ownership tracked, declare it explicitly via `owner` (simple, human-readable) or the richer `owners.team` / `owners.github_team` block. Neither routes reviews; set PR reviewers in `policy.yaml`.

***

## Backstage compatibility

Core field names are taken from the [Backstage entity model](https://backstage.io/docs/features/software-catalog/descriptor-format). This is a **one-shot import**, not continuous sync: sureops's starter generator can parse a Backstage `kind: Component` catalog — provided as a URL to a hosted `catalog-info.yaml`, pasted YAML, or an uploaded file — and use it to seed a generated `services.yaml` once. After that, `services.yaml` and `catalog-info.yaml` are two independent files — editing one does not update the other.

Only `Component` entities are imported, and only if `spec.type` is either absent or set to `service` — a `Component` with an explicit non-`service` type (e.g. `website`, `library`) is skipped. Each imported one **must** carry a source-location annotation so sureops can derive `git_repo` — without it, the importer skips the component entirely:

```yaml theme={null}
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: payment
  description: "Payment processing service"
  annotations:
    # Required — the importer can't derive git_repo without one of these.
    github.com/project-slug: acme/payment
    # backstage.io/source-location: url:https://github.com/acme/payment
  tags: [tier-1]
spec:
  type: service
  owner: team:payments-team
  dependsOn:
    - component:checkout
    - component:currency
```

`spec.owner`, `metadata.tags`, `metadata.description`, and `spec.dependsOn` map onto the equivalent `services.yaml` fields; component names that don't match the OTel naming rule are coerced (lowercased, invalid characters replaced with `-`). Fields not read by the importer (e.g. `spec.lifecycle`) are simply dropped from the generated `services.yaml` — edit the file afterward to add anything the import didn't capture.

***

## Conflict resolution with auto-discovery

sureops discovers services from your telemetry (OTel service names, Kubernetes labels) before they're in your contract. But once a service is declared in `services.yaml` and merged, the node is locked: telemetry can still refresh its "last seen" timestamp, but it can no longer add or change any field on that node — including one you never declared. There's no fill-in-the-gaps merge after that point; the contract entry becomes the whole record.

**Every ingest applies your edits.** When you change a service in `services.yaml` and the new version is ingested, changed attributes replace the old values and attributes you removed are cleared. The service's owner, runbook, repository and dependency links are replaced too: the old link is removed, so a service has one owner and one runbook, not both the old and the new. Identifiers that act as aliases (`identifiers.otel_service_name`, `identifiers.k8s_label_selector`, `identifiers.k8s_deployment_name`, the image repository and `owners.github_team`) are additive: a new value is added but the old one is not removed. An old OpenTelemetry service name, Kubernetes label or deployment name still matches the service, and an old Kubernetes label or deployment name can be shown to agents instead of, or as well as, the new one. If you move one of these names to a different service, it can still match the old service. To remove an old value, ask sureops support. Fix PRs go to `source.repo` when it is set, otherwise to `git_repo`. Changing that value moves the repository link: new fix PRs are opened against the new repository, and fix PRs already open on the old one stay there. While `source.repo` is set, changing only `git_repo` does not move fix PRs. A service you delete from `services.yaml` keeps its existing record, although other services' `depends_on` links to it are dropped. See [Customer Landscape](https://docs.sureops.ai/your-rules/customer-landscape.md#conflict-resolution).

Source ranking (highest wins): **Manual** > **Customer contract** > **sureops contract** > **Telemetry** > **Kubernetes** > **GitHub** / **AWS** (the labels on the Coverage page). Once your `services.yaml` is merged into your knowledge base repo — whether you wrote it from scratch or merged a generated starter as-is — it counts as **Customer contract**, the second-highest tier. A service you corrected by hand from an incident is ranked **Manual**; the next ingest still applies the fields your `services.yaml` declares and resets it to **Customer contract**, keeping the correction details. (**sureops contract** is a lower tier for sureops-provisioned facts you haven't touched — see [Customer Landscape](https://docs.sureops.ai/your-rules/customer-landscape.md).)

In practice: declare everything you want present on a contract-declared service, including anything telemetry would otherwise have supplied — for example `identifiers.k8s_namespace`. It's the only way a namespace ever lands on a contract-declared service, since telemetry can't add one after the fact once the service is locked. You can add it in a later edit; the next ingest applies it.

***

## Validation rules

* `name` must match OTel service name format: lowercase letters, digits, and hyphens; must start with a letter; unique within the file
* `git_repo` is required and must be `<owner>/<repo>` shape — no `github.com/` prefix, no full URL
* `depends_on` (snake\_case — `dependsOn` produces an "unknown field" warning, same as `tier`/`type`/`lifecycle`) must be a list of strings; references should resolve to other entries in the same file — unknown references produce a warning, not an error
* `tier`, `type`, and `lifecycle` are not recognized fields — including them produces an "unknown field" warning, not an error, and nothing reads the value
* Nested blocks (`identifiers`, `image`, `source`, `owners`, `deploy`, `health`) must be mappings if present

Ingest failures (a hard parse/validation error) show as banner text — "Last contract ingest failed: `<reason>`" — on the Knowledge Base settings page. Soft warnings (like an unknown-field notice) don't render there; an Owner, Admin, or Compliance Officer can run a validation pass from the **.sureops/ Repo** browser (**Settings → Organization → Knowledge Base → Browse in app → Validate**) to see the full warnings list.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.