How Lear works
One incident, taken apart
Lear is an on-call engineer for agencies that run many client systems. It finds the cause, proposes one fix, and acts only when a person approves it. Below is one example incident, taken apart into the seven layers Lear builds, with the rule each layer can’t skip.
Example incident: at 14:02 a deploy cut the payments connection pool from 20 to 2 and checkout began returning 502s. Not a customer deployment.
01 · Signals
It watches first, with read access only
Lear polls the tools the client already uses: health checks, metrics, error trackers, deploy history. Watching needs no write permission, and a watch that fails to read says so. A broken watch never opens an incident.
Signals at 14:03| 14:03:10 | uptime | 502 on 31% of /pay |
| 14:03:10 | metrics | payments-db pool 2 of 2, 148 waiting |
| 14:02:41 | deploys | checkout a91f3c2, merged #482 |
02 · One incident
Three alerts become one problem
The uptime check, the database and the deploy feed all describe the same service in the same few minutes. Lear groups them by the service they concern, not only by when they fired, so you get one incident instead of three pages.
paymentsprod3 signalsopened 14:03
03 · Evidence
Every reading gets a number
Before anything is concluded, each reading Lear will rely on is written down and numbered: the error rate, the pool, the deploy, the diff, and the fact that nothing else changed in that window.
REF-01 /pay 502 rate, 14:02 to 14:03REF-02 payments-db pool saturationREF-03 deploy a91f3c2 at 14:02:41REF-04 config/payments.yaml, pool_size 20 → 2REF-05 no other change in the window
04 · Diagnosis
A claim without a reading doesn’t reach you
Lear’s explanation has to point at the numbered readings, and every pointer is checked against what was read before you see it. A claim that points at nothing, or at a reading that doesn’t support it, is thrown out.
The 502s began 29 seconds after deploy a91f3c2 REF-03, which lowered the pool from 20 to 2 REF-04. The pool has been full since REF-02, and nothing else changed REF-05.
05 · The plan
You approve this exact text, once
Lear proposes one fix and says what changes, where, and how it will tell whether it worked. Your approval is tied to that exact plan. If one character of it changes, the approval no longer applies. It works once, and it expires. Chat, alerts and the model can suggest. Only a person approves.
Roll back checkout to the 14:01 build
- Where
deployment/checkout in prod, nothing else- Check
- the three signals that opened the incident, for 5 minutes
- If it fails
- undo the change and keep the incident open
06 · Verification
It checks the signals that opened the incident
After the change, Lear does not ask itself whether things look better. It watches the same signals that opened the incident until they hold for the whole window. That is the only way an incident becomes recovered.
/pay 200, 41 ms median, 5 minutes clean- payments-db pool 20 of 20 available
07 · Ledger
A record nobody can edit quietly
Every step lands in an append-only ledger. Any edit to an old line is detectable, and the check points at the first line that changed. At the end of the month the same record becomes the client’s incident report.
Ledger entries for this incident| 14:03:10 | Incident opened from 3 signals |
| 14:03:52 | Diagnosis with 4 citations |
| 14:06:02 | Plan approved by a person |
| 14:11:09 | Recovery verified |