Loopypeterzakin/loopy

example · workflows/confirm/

Confirm

When a metric crosses its threshold, confirm the shipped goal actually moved it — or reopen it.

The steps

1 step in workflows/confirm/

check.md
---
on: MetricThreshold
agent: Reviewer
---
Confirm whether goal {{ event.goal_id }} actually moved the metric, or reopen it.

The trigger

A poll emits a MetricThreshold event when a goal needs checking. The sensor lives in sensors/sensors.py:

sensors/sensors.py
from loopy import sensor
from loopy.events import Incident, MetricThreshold


@sensor(poll="5m", emits="MetricThreshold")
def metric_watch(req) -> MetricThreshold:
    return MetricThreshold(goal_id="g-123")

From the registry

The agents and events this workflow refers to by name, from registry.yml.

registry.yml
defaults:
  agent:
    sandbox: default
    harness: { runtime: claude-code, model: claude-sonnet-4-6 }

sandboxes:
  default:
    provider: daytona
    image: { debian_slim: "3.12", apt: [git], workdir: /home/daytona, user: daytona }
    network: [github.com]

agents:
  Reviewer: { tools: [run_evals], skills: [code-review] }

events:
  MetricThreshold:
    fields: { goal_id: id }
open on github → back to overview