← Guides · 日本語 · Português · 中文

Updated 2026-11-19

On this page
  1. The pattern
  2. Prerequisites
  3. Step 1 — The outcome prompt
  4. Step 2 — Schedule it
  5. Step 3 — Realistic conditions matter
  6. Step 4 — Noise discipline
  7. Step 5 — Evidence in every fix
  8. Verify it
  9. Pitfalls
  10. Knowledge check
  11. Sources

Guide 3 — Scheduled-sentinel Bot

Goal: a Bot that owns a recurring quality check — runs it on a schedule, triages failures, traces them to the cause, and ships fixes. Level: intermediate Source deployment: Cognition's Layout Bot — watches layout-shift regression on the Devin web app. Every 3 hours it builds production main, simulates first/repeat/delayed-request visits, and ships fixes. 159 PRs in 3 weeks; lag −70%. Sources: launch post · Automations docs

The pattern

Some work is never done — it recurs on a clock: performance budgets, visual regression, dependency freshness, secret scans, uptime. A sentinel Bot owns the check itself, not just the fixes: it keeps the check working as the codebase changes, filters noise, and opens a fix only when the regression is real.

cron ──► Bot wakes ──► run check under realistic conditions
                           │
              pass ────────┴──────── fail
               │                       │
             quiet            rerun to filter flakes
                                       │
                              trace to introducing PR
                                       │
                          fix PR + before/after evidence

Prerequisites

Step 1 — The outcome prompt

Reconstructed from the Layout Bot's documented behavior:

Your job is to keep <surface> from <regressing>.

Watch <check/channel>, where <the check> posts every <interval>. Take over
that check and keep it working as the code changes. When something
regresses: rerun to rule out flakiness, trace the regression to the PR
that introduced it, and open a fix PR with before/after evidence.

Examples of the <check> slot, all seen in real deployments:

Step 2 — Schedule it

Ask the Bot in chat:

Run this check every 3 hours on a schedule.

The Bot proposes an automation; you approve once. (Guide 6 covers hand-built automations if you'd rather wire the cron yourself.) Manage it later under the Bot's Settings → Automations.

Step 3 — Realistic conditions matter

The Layout Bot's check isn't one run — it simulates first visit, repeat visit, and individually delayed requests, because the regression it hunts only shows under specific load shapes. Encode your equivalent:

Step 4 — Noise discipline

Two rules keep a sentinel from crying wolf:

  1. Rerun before acting — the Layout Bot reruns flaky-looking results before treating them as real. Write it into the prompt: "rerun any failed check once before acting on it."
  2. Trace before fixing — each regression gets traced to the introducing PR. A fix without a cause is a guess.

Step 5 — Evidence in every fix

Each of the 159 PRs carries before/after video. Equivalent evidence for your check:

Check Evidence in the fix PR
Layout/visual Screen recording or screenshots, before vs. after
Latency Timing numbers, same measurement both ways
Dead code Why the code is unreachable
Dependencies/CVEs The advisory + the diff that resolves it

Verify it

Pitfalls

Knowledge check

  1. Why does the sentinel build production main on a cron rather than waiting for failures to be reported? (The outcome is 'no regressions', not 'fix reported bugs' — ownership means finding problems before humans do.)
  2. Layout Bot ships fixes with before/after videos — what decision does that enable for the reviewer? (Merge confidence without reproducing locally; the proof travels with the PR.)
  3. Why trace a regression to its introducing PR instead of fixing the symptom? (Ownership of a check means owning its history — the fix lands on the cause and the knowledge persists.)

Sources