Skip to content

Active Learning and Cross-Service Incident Correlation

Faber includes two feedback and signal-reduction loops that keep operations sharp as your cluster grows:

  1. Closed-Loop Active Learning: Turns real operator corrections into a single reviewable .faber/rules.md Pull Request so Faber stops repeating the same mistake twice.
  2. Cross-Service Incident Correlation: Collapses a burst of related alerts across many workloads (for example 12 services failing during one PostgreSQL outage) into a single root-cause RemediationRun.

Both features are built into the controller binary with zero extra pods. Active learning is enabled by default and never mutates your repository silently: every rule update goes through a normal Pull or Merge Request.

Every time a human corrects Faber, or a run proposes a durable guideline, Faber records a normalized LearningSignal in its backing store (SQLite or PostgreSQL).

Faber captures five signal sources:

Signal Source When Faber Records It
pr_review A reviewer leaves comments or requests changes on an open Faber Pull or Merge Request
pr_closed A Faber Pull or Merge Request is closed without merging (captures the closing rationale)
pr_human_edit A human pushes a follow-up commit onto a Faber PR branch before merging
hitl_rejection An operator rejects a WaitingApproval checkpoint with a rejection comment
suggested_rule A completed run emits a suggestedRule recommendation for future runs

A leader-elected background sweeper runs every --learning-interval (default 15m, set to 0 to disable background sweeps). For each eligible GitOpsRepository, the distiller:

  1. Checks that active learning is enabled globally and on the repository, that at least minSignals unconsumed signals exist (default 2), and that the repository cooldown has elapsed (default 24h).
  2. Reads the existing rules file (default .faber/rules.md) from the repository default branch.
  3. Deduplicates candidate rules against existing bullets and enforces maxRules (default 100).
  4. Opens or updates a single Pull or Merge Request on branch agent/learning/rules-update (as a Draft PR by default).
  5. Marks the consumed signals and tracks the proposal in the backing store.

Once a human reviews and merges .faber/rules.md, Faber automatically fetches it from the default branch and injects it into Layer 1 of the three-layer context model (capped at 2048 bytes on a clean line boundary so the cached prompt prefix stays compact).

Configuring Per-Repository Learning (GitOpsRepository.spec.learning)

Section titled “Configuring Per-Repository Learning (GitOpsRepository.spec.learning)”

Active learning is enabled by default when spec.learning is omitted. You can customize the rules file path, cadence, thresholds, draft status, and PR labels on any GitOpsRepository:

apiVersion: faberops.dev/v1alpha1
kind: GitOpsRepository
metadata:
name: home-ops
namespace: faber
spec:
# forge, context, validation, and guardrails omitted for brevity
learning:
enabled: true
rulesFile: .faber/rules.md
cooldown: 24h
minSignals: 2
maxRules: 100
draft: true
prLabels:
- faber-learning

rulesFile must be a repository-relative path with no leading / and no .. traversal segments (enforced by CRD CEL validation).

Key defaults when fields are omitted:

Field Default Bounds / Notes
enabled true Set to false to opt a single repository out
rulesFile .faber/rules.md Relative path, max 256 characters
cooldown 24h Minimum wait between automated learning PR updates
minSignals 2 Range 1 to 100 unconsumed signals required
maxRules 100 Range 1 to 500 active rules retained in rulesFile
draft true Opens agent/learning/rules-update as a Draft PR when true
prLabels [] Optional forge labels (up to 10 items)

See config/samples/home-ops-repository.yaml for a complete manifest.

Inspecting Signals and Triggering Proposals

Section titled “Inspecting Signals and Triggering Proposals”

Use faberctl or the HTTP API to inspect captured signals, review proposal history, or trigger a rules PR immediately without waiting for the next sweep.

CLI examples:

Terminal window
# List captured learning signals and proposals
faberctl learning list --repo home-ops --namespace faber
# Show only unconsumed signals waiting to be distilled
faberctl learning list --repo home-ops --unconsumed --limit 50
# Trigger a proposal pass now (respects cooldown and minSignals)
faberctl learning propose --repo home-ops --namespace faber
# Force a proposal immediately, bypassing cooldown and minSignals
faberctl learning propose --repo home-ops --namespace faber --force

HTTP API endpoints:

  • GET /api/v1/learning: Returns { "enabled", "signals", "proposals" }. Accepts optional query parameters namespace, repo, unconsumed=true|false, and limit (1 to 500, default 100).
  • POST /api/v1/learning/propose: Runs one distillation pass for a repository. Accepts JSON body { "namespace": "faber", "repo": "home-ops", "force": false } and returns { "status", "reason", "proposal" }.
Terminal window
curl -sS "http://127.0.0.1:8080/api/v1/learning?namespace=faber&repo=home-ops&unconsumed=true"
curl -sS -X POST "http://127.0.0.1:8080/api/v1/learning/propose" \
-H "Content-Type: application/json" \
-d '{"namespace":"faber","repo":"home-ops","force":true}'

When --auth-mode=oidc or --auth-mode=k8s is enabled, both endpoints enforce the same namespace authorization and RBAC rules as the rest of /api/v1/*.

You can disable active learning at either scope:

  • Per repository: Set GitOpsRepository.spec.learning.enabled: false. Other repositories in the cluster continue learning normally.
  • Globally (controller-wide): Pass --learning=false (or set FABER_LEARNING_ENABLED=false), or install/upgrade via Helm with --set learning.enabled=false.
Terminal window
helm upgrade --install faber oci://ghcr.io/faberops/charts/faber \
--version 2.0.0 \
--namespace faber \
--set learning.enabled=false

Part 2: Cross-Service Incident Correlation

Section titled “Part 2: Cross-Service Incident Correlation”

When a shared dependency fails (such as a primary PostgreSQL instance, DNS resolver, or Redis cluster), a dozen downstream deployments often emit matching log errors or alerts within seconds of each other. Without correlation, a policy would spawn 12 separate RemediationRun investigations for the same root cause.

Cross-service incident correlation (spec.correlation) buffers related trigger events over a short collection window and dispatches one single root-cause RemediationRun containing the full list of affected workloads and absorbed trigger evidence.

All asynchronous trigger sources feed into the correlator when spec.correlation.enabled: true: Kubernetes watches, webhooks and pkg/trigger CloudEvents, podLog, logQuery, metricQuery, and httpPoll.

Grouping Modes and Configuration (spec.correlation)

Section titled “Grouping Modes and Configuration (spec.correlation)”

Configure spec.correlation directly on a MaintenancePolicy, or set shared defaults on a PolicyTemplate (fields on the policy override the template).

apiVersion: faberops.dev/v1alpha1
kind: MaintenancePolicy
metadata:
name: correlated-db-outage-triage
namespace: faber
spec:
correlation:
enabled: true
groupBy: signature
window: 30s
maxGroupSize: 20

Supported fields:

Field Default Allowed Values / Bounds
enabled false true or false
window 30s Duration greater than 0s and at most 5m (enforced by CEL)
groupBy signature signature, namespace, owner, or policy
maxGroupSize 20 Integer 2 to 100 (flushes immediately once the group reaches this count)

Choose the groupBy strategy that matches your blast radius:

  • signature (recommended for shared-dependency outages): Groups events that share the same normalized failure signature (for example db-pool-exhausted across checkout, billing, and orders in different namespaces).
  • namespace: Groups all burst triggers hitting workloads in the same Kubernetes namespace.
  • owner: Groups burst triggers sharing the same owning Kubernetes controller or workload owner.
  • policy: Collapses every burst trigger targeting the same MaintenancePolicy within the window into one run.

See config/samples/correlated-db-outage-policy.yaml for a full runnable example.

Inspecting Correlated Runs (status.correlation)

Section titled “Inspecting Correlated Runs (status.correlation)”

When a correlated window flushes, Faber creates one RemediationRun, injects the correlated incident summary and affected workload list into the agent prompt, and records compact metadata on RemediationRun.status.correlation:

status:
correlation:
groupId: "sig-db-pool-exhausted-8f2a1c"
groupBy: "signature"
absorbedCount: 11
affectedWorkloads:
- "apps/checkout"
- "apps/billing"
- "apps/orders"
summary: "12 correlated events grouped by signature across 12 workloads"
windowStartedAt: "2026-11-30T21:10:00Z"
windowClosedAt: "2026-11-30T21:10:30Z"

affectedWorkloads is capped at 50 entries and summary at 1024 characters so RemediationRun.status stays well below the 64 KiB etcd budget.

Faber exports Prometheus counters on :9090/metrics for both features:

  • faber_learning_signals_total{source}: Total feedback signals recorded (pr_review, pr_closed, pr_human_edit, hitl_rejection, suggested_rule).
  • faber_learning_proposals_total{status}: Total active learning rules proposals tracked by status.
  • faber_correlated_events_total{policy,group_by}: Total trigger events absorbed into correlated runs instead of spawning duplicate runs.