Sync v0.7.0 implementation kit
Browse files- CITATION.bib +1 -1
- CITATION.cff +2 -2
- README.de.md +1 -1
- README.es.md +1 -1
- README.fr.md +1 -1
- README.ja.md +1 -1
- README.ko.md +1 -1
- README.md +9 -9
- README.pt-BR.md +1 -1
- README.zh-CN.md +1 -1
- assets/social-preview.png +2 -2
- data/resource_source_audit.csv +0 -0
- data/resources.csv +0 -0
- data/resources.jsonl +0 -0
- design-qa.md +27 -35
- docs/assets/resources.json +0 -0
- docs/assets/social-preview-545-v07.png +3 -0
- docs/assets/social-preview.png +2 -2
- docs/index.html +48 -25
- docs/sitemap.xml +1 -1
- docs/{x-v06-540.html → x-v07-545.html} +12 -12
- examples/README.md +113 -62
- examples/accessibility-regression-loop.json +60 -0
- examples/adversarial-red-team-loop.json +60 -0
- examples/benchmark-optimization-loop.json +60 -0
- examples/knowledge-freshness-loop.json +60 -0
- examples/performance-regression-loop.json +60 -0
- examples/runnable/README.md +117 -38
- examples/runnable/queue-worker-loop.py +206 -0
- examples/runnable/threshold-monitor-loop.sh +126 -0
- meta/DISTRIBUTION.md +14 -14
- meta/OUTREACH.md +1 -1
- meta/hf_card_body.md +3 -3
- meta/social-preview.html +4 -4
- patterns/MATRIX.md +6 -1
- patterns/README.md +80 -37
- patterns/accessibility-regression-loop.md +100 -0
- patterns/adversarial-red-team-loop.md +107 -0
- patterns/benchmark-optimization-loop.md +105 -0
- patterns/knowledge-freshness-loop.md +103 -0
- patterns/performance-regression-loop.md +101 -0
- posts/launch.md +28 -22
- posts/launch.zh-CN.md +29 -23
CITATION.bib
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
title = {Awesome Loop Engineering},
|
| 4 |
year = {2026},
|
| 5 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 6 |
-
note = {Curated resources for Loop Engineering, version 0.
|
| 7 |
}
|
|
|
|
| 3 |
title = {Awesome Loop Engineering},
|
| 4 |
year = {2026},
|
| 5 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 6 |
+
note = {Curated resources for Loop Engineering, version 0.7.0}
|
| 7 |
}
|
CITATION.cff
CHANGED
|
@@ -2,8 +2,8 @@ cff-version: 1.2.0
|
|
| 2 |
message: "If this repository is useful in your work, please cite it as below."
|
| 3 |
title: "Awesome Loop Engineering"
|
| 4 |
type: software
|
| 5 |
-
version: 0.
|
| 6 |
-
date-released: 2026-07-
|
| 7 |
authors:
|
| 8 |
- family-names: "He"
|
| 9 |
given-names: "Chaoyue"
|
|
|
|
| 2 |
message: "If this repository is useful in your work, please cite it as below."
|
| 3 |
title: "Awesome Loop Engineering"
|
| 4 |
type: software
|
| 5 |
+
version: 0.7.0
|
| 6 |
+
date-released: 2026-07-18
|
| 7 |
authors:
|
| 8 |
- family-names: "He"
|
| 9 |
given-names: "Chaoyue"
|
README.de.md
CHANGED
|
@@ -28,7 +28,7 @@ Ein Loop entdeckt Arbeit, übergibt sie an einen oder mehrere Agenten, prüft da
|
|
| 28 |
|
| 29 |
Dieses Repository behandelt die neue Bedeutung von Loop Engineering im Kontext von KI-Agenten und Coding Agents. Es geht nicht um Software-Event-Loops, Regelungstechnik, Growth Loops, generische Automatisierung oder nicht-KI-bezogene Feedback-Loops.
|
| 30 |
|
| 31 |
-
Neben
|
| 32 |
|
| 33 |
## Mentales Modell
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
Dieses Repository behandelt die neue Bedeutung von Loop Engineering im Kontext von KI-Agenten und Coding Agents. Es geht nicht um Software-Event-Loops, Regelungstechnik, Growth Loops, generische Automatisierung oder nicht-KI-bezogene Feedback-Loops.
|
| 30 |
|
| 31 |
+
Neben 545 kuratierten Ressourcen bietet dieses Repository 20 Loop-Patterns, einen schemavalidierten Loop-Contract pro Pattern, 8 Runtime-Starter (3 ausführbare Programme und 5 Copy-and-paste-Vorlagen), eine Community-Galerie und 8 Sprachen.
|
| 32 |
|
| 33 |
## Mentales Modell
|
| 34 |
|
README.es.md
CHANGED
|
@@ -28,7 +28,7 @@ Un loop descubre trabajo, lo delega a uno o más agentes, verifica el resultado,
|
|
| 28 |
|
| 29 |
Este repositorio se centra en el significado nuevo de Loop Engineering para agentes de IA y coding agents. No trata sobre event loops de software, teoría de control, growth loops, automatización genérica o feedback loops no relacionados con IA.
|
| 30 |
|
| 31 |
-
Además de
|
| 32 |
|
| 33 |
## Modelo Mental
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
Este repositorio se centra en el significado nuevo de Loop Engineering para agentes de IA y coding agents. No trata sobre event loops de software, teoría de control, growth loops, automatización genérica o feedback loops no relacionados con IA.
|
| 30 |
|
| 31 |
+
Además de 545 recursos curados, este repositorio incluye 20 patrones de loop, un loop contract validado por esquema para cada patrón, 8 puntos de partida de runtime (3 ejecutables y 5 plantillas listas para adaptar), una galería comunitaria y 8 idiomas.
|
| 32 |
|
| 33 |
## Modelo Mental
|
| 34 |
|
README.fr.md
CHANGED
|
@@ -28,7 +28,7 @@ Un loop découvre du travail, le délègue à un ou plusieurs agents, vérifie l
|
|
| 28 |
|
| 29 |
Ce dépôt concerne le nouveau sens de Loop Engineering dans le contexte des agents IA et coding agents. Il ne concerne pas les event loops logiciels, la théorie du contrôle, les growth loops, l'automatisation générique ou les feedback loops non liés à l'IA.
|
| 30 |
|
| 31 |
-
Au-delà de
|
| 32 |
|
| 33 |
## Modèle Mental
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
Ce dépôt concerne le nouveau sens de Loop Engineering dans le contexte des agents IA et coding agents. Il ne concerne pas les event loops logiciels, la théorie du contrôle, les growth loops, l'automatisation générique ou les feedback loops non liés à l'IA.
|
| 30 |
|
| 31 |
+
Au-delà de 545 ressources sélectionnées, ce dépôt fournit 20 patterns de loop, un loop contract validé par schéma pour chaque pattern, 8 points de départ d'exécution (3 exécutables et 5 modèles prêts à adapter), une galerie communautaire et 8 langues.
|
| 32 |
|
| 33 |
## Modèle Mental
|
| 34 |
|
README.ja.md
CHANGED
|
@@ -28,7 +28,7 @@ Loop は作業を発見し、1 つ以上の agents に委任し、結果を確
|
|
| 28 |
|
| 29 |
このリポジトリは AI agents / coding agents における新しい意味の Loop Engineering に限定しています。software event loop、制御理論、growth loop、一般的な workflow automation、非 AI の feedback loop は対象外です。
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
## メンタルモデル
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
このリポジトリは AI agents / coding agents における新しい意味の Loop Engineering に限定しています。software event loop、制御理論、growth loop、一般的な workflow automation、非 AI の feedback loop は対象外です。
|
| 30 |
|
| 31 |
+
545 件の精選リソースに加えて、本リポジトリは 20 個の loop パターン、各パターンに対応する schema 検証済み loop contract、8 個の runtime starter(3 個の実行ファイルと 5 個の適応可能なテンプレート)、コミュニティ gallery、8 言語を提供します。
|
| 32 |
|
| 33 |
## メンタルモデル
|
| 34 |
|
README.ko.md
CHANGED
|
@@ -28,7 +28,7 @@ Loop 는 작업을 발견하고, 하나 이상의 agents 에게 위임하고,
|
|
| 28 |
|
| 29 |
이 저장소는 AI agents / coding agents 맥락의 새로운 Loop Engineering 의미에만 집중합니다. software event loop, control theory, growth loop, 일반적인 workflow automation, 비 AI feedback loop 는 범위에 포함하지 않습니다.
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
## 멘탈 모델
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
이 저장소는 AI agents / coding agents 맥락의 새로운 Loop Engineering 의미에만 집중합니다. software event loop, control theory, growth loop, 일반적인 workflow automation, 비 AI feedback loop 는 범위에 포함하지 않습니다.
|
| 30 |
|
| 31 |
+
545개의 엄선된 리소스 외에도 이 저장소는 20개의 loop 패턴, 각 패턴에 대한 스키마 검증 loop contract, 8개의 runtime starter(실행 파일 3개와 적용 가능한 템플릿 5개), 커뮤니티 gallery, 8개 언어를 제공합니다.
|
| 32 |
|
| 33 |
## 멘탈 모델
|
| 34 |
|
README.md
CHANGED
|
@@ -38,7 +38,7 @@ configs:
|
|
| 38 |
<h1 align="center">Awesome Loop Engineering Dataset</h1>
|
| 39 |
|
| 40 |
<p align="center">
|
| 41 |
-
A source-audited dataset of
|
| 42 |
</p>
|
| 43 |
|
| 44 |
<p align="center">
|
|
@@ -52,16 +52,16 @@ configs:
|
|
| 52 |
|
| 53 |
Each row represents one resource from the canonical English field guide. It pairs a concise editorial assessment with bibliographic metadata, lifecycle and audience facets, evidence classification, audit status, and point-in-time repository statistics when applicable.
|
| 54 |
|
| 55 |
-
Current release: **v0.
|
| 56 |
|
| 57 |
| Surface | Count |
|
| 58 |
| --- | ---: |
|
| 59 |
-
| Source-audited resources |
|
| 60 |
-
| Operational patterns |
|
| 61 |
-
| Validated loop contracts |
|
| 62 |
-
|
|
| 63 |
|
| 64 |
-
The source audit dated **2026-07-17**
|
| 65 |
|
| 66 |
## Load The Data
|
| 67 |
|
|
@@ -98,7 +98,7 @@ Use `url` as the durable join key. `row_id` and `source_line` are positional and
|
|
| 98 |
- Compare works by lifecycle, audience, evidence class, source type, and publication metadata.
|
| 99 |
- Build literature maps, reading lists, dashboards, or retrieval indexes.
|
| 100 |
- Audit contribution, novelty, impact, provenance, and evidence claims.
|
| 101 |
-
- Find reusable patterns, contracts, schemas, and
|
| 102 |
|
| 103 |
Do not use `signal_strength`, GitHub stars, forks, or inclusion in this collection as a quality label, endorsement, or automated ranking of scientific validity.
|
| 104 |
|
|
@@ -149,6 +149,6 @@ GitHub Releases define versioned snapshots; cite a release or commit for reprodu
|
|
| 149 |
title = {Awesome Loop Engineering},
|
| 150 |
year = {2026},
|
| 151 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 152 |
-
note = {Version 0.
|
| 153 |
}
|
| 154 |
```
|
|
|
|
| 38 |
<h1 align="center">Awesome Loop Engineering Dataset</h1>
|
| 39 |
|
| 40 |
<p align="center">
|
| 41 |
+
A source-audited dataset of 545 papers, official docs, tools, benchmarks, patterns, critiques, and implementation guides for recurring AI-agent systems.
|
| 42 |
</p>
|
| 43 |
|
| 44 |
<p align="center">
|
|
|
|
| 52 |
|
| 53 |
Each row represents one resource from the canonical English field guide. It pairs a concise editorial assessment with bibliographic metadata, lifecycle and audience facets, evidence classification, audit status, and point-in-time repository statistics when applicable.
|
| 54 |
|
| 55 |
+
Current release: **v0.7.0**
|
| 56 |
|
| 57 |
| Surface | Count |
|
| 58 |
| --- | ---: |
|
| 59 |
+
| Source-audited resources | 545 |
|
| 60 |
+
| Operational patterns | 20 |
|
| 61 |
+
| Validated loop contracts | 20 |
|
| 62 |
+
| Runtime starters | 8 |
|
| 63 |
|
| 64 |
+
The source audit dated **2026-07-17** reports these row statuses: **496 reachable public**, **1 access restricted**, **48 repository-native**, and **0 broken or unreachable**.
|
| 65 |
|
| 66 |
## Load The Data
|
| 67 |
|
|
|
|
| 98 |
- Compare works by lifecycle, audience, evidence class, source type, and publication metadata.
|
| 99 |
- Build literature maps, reading lists, dashboards, or retrieval indexes.
|
| 100 |
- Audit contribution, novelty, impact, provenance, and evidence claims.
|
| 101 |
+
- Find reusable patterns, contracts, schemas, executable examples, and copy/paste runtime templates.
|
| 102 |
|
| 103 |
Do not use `signal_strength`, GitHub stars, forks, or inclusion in this collection as a quality label, endorsement, or automated ranking of scientific validity.
|
| 104 |
|
|
|
|
| 149 |
title = {Awesome Loop Engineering},
|
| 150 |
year = {2026},
|
| 151 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 152 |
+
note = {Version 0.7.0}
|
| 153 |
}
|
| 154 |
```
|
README.pt-BR.md
CHANGED
|
@@ -28,7 +28,7 @@ Um loop descobre trabalho, delega para um ou mais agentes, verifica o resultado,
|
|
| 28 |
|
| 29 |
Este repositório trata do novo significado de Loop Engineering no contexto de AI agents e coding agents. Ele não trata de event loops de software, teoria de controle, growth loops, automação genérica ou feedback loops não relacionados a IA.
|
| 30 |
|
| 31 |
-
Além de
|
| 32 |
|
| 33 |
## Modelo Mental
|
| 34 |
|
|
|
|
| 28 |
|
| 29 |
Este repositório trata do novo significado de Loop Engineering no contexto de AI agents e coding agents. Ele não trata de event loops de software, teoria de controle, growth loops, automação genérica ou feedback loops não relacionados a IA.
|
| 30 |
|
| 31 |
+
Além de 545 recursos curados, este repositório inclui 20 patterns de loop, um loop contract validado por schema para cada pattern, 8 starters de runtime (3 executáveis e 5 templates prontos para adaptação), uma galeria comunitária e 8 idiomas.
|
| 32 |
|
| 33 |
## Modelo Mental
|
| 34 |
|
README.zh-CN.md
CHANGED
|
@@ -32,7 +32,7 @@ Prompt engineering 改进你对模型说什么。Context engineering 改进模
|
|
| 32 |
|
| 33 |
本仓库不收录软件事件循环、控制论、增长循环、通用 workflow automation 或非 AI feedback loop。
|
| 34 |
|
| 35 |
-
除资源列表外,本仓库还维护
|
| 36 |
|
| 37 |
## 一句话定位
|
| 38 |
|
|
|
|
| 32 |
|
| 33 |
本仓库不收录软件事件循环、控制论、增长循环、通用 workflow automation 或非 AI feedback loop。
|
| 34 |
|
| 35 |
+
除资源列表外,本仓库还维护 545 条经过审阅的资源记录,并提供 20 个 loop 模式、20 个经 schema 校验的 loop contracts、8 个 runtime starters(3 个可直接执行,5 个可复制改造)、社区 gallery,以及 8 个语言入口。
|
| 36 |
|
| 37 |
## 一句话定位
|
| 38 |
|
assets/social-preview.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
data/resource_source_audit.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/resources.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/resources.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
design-qa.md
CHANGED
|
@@ -12,16 +12,16 @@
|
|
| 12 |
|
| 13 |
## Viewports And States
|
| 14 |
|
| 15 |
-
- Desktop first viewport: 1440 x
|
| 16 |
-
- Mobile first viewport: 390 x 844, page top,
|
| 17 |
-
- Mobile navigation:
|
| 18 |
-
- Pattern library:
|
| 19 |
-
- Contract: mobile
|
| 20 |
-
- Runtime map: desktop
|
| 21 |
-
- Maturity model: desktop
|
| 22 |
-
- Social preview: 1280 x 640, exact resource, pattern, and
|
| 23 |
-
- Interactive hero, desktop:
|
| 24 |
-
- Interactive hero, mobile: 390 x 844, one ready WebGL canvas,
|
| 25 |
- Interactive hero motion: the frame counter advanced by 47 frames during a 450 ms pointer-parallax check.
|
| 26 |
- Interactive hero efficiency: the frame counter advanced by zero during a 700 ms offscreen check at the Resources section.
|
| 27 |
|
|
@@ -37,6 +37,8 @@
|
|
| 37 |
8. Compared the published static hero and the Three.js-enhanced hero at the same 1280 x 720 viewport. The enhancement keeps the existing identity, copy, actions, spacing, and section transition while adding a restrained evidence orbit, control-plane stack, verification gate, and six lifecycle nodes behind the content.
|
| 38 |
9. Moved the control-plane stack and verification gate outward after the first 3D pass so they frame the copy rather than crossing its reading path. Rechecked desktop and mobile rendering after the adjustment.
|
| 39 |
10. Verified progressive enhancement behavior: the semantic hero remains complete without WebGL, forced-colors and print hide the scene, reduced-motion renders a static frame, and the animation stops when the hero leaves the viewport.
|
|
|
|
|
|
|
| 40 |
|
| 41 |
## Findings
|
| 42 |
|
|
@@ -49,39 +51,29 @@
|
|
| 49 |
|
| 50 |
## Focused Evidence
|
| 51 |
|
| 52 |
-
- Desktop hero: `/private/tmp/
|
| 53 |
-
- Mobile hero: `/private/tmp/
|
| 54 |
-
-
|
| 55 |
-
- Mobile pattern
|
| 56 |
-
- Desktop runtime map: `/private/tmp/
|
| 57 |
-
- Mobile runtime
|
| 58 |
-
- Mobile maturity model: `/private/tmp/awesome-loop-maturity-mobile.png`
|
| 59 |
-
- Three.js desktop hero: `/private/tmp/awesome-loop-hero-three-desktop-final.png`
|
| 60 |
-
- Three.js mobile hero: `/private/tmp/awesome-loop-hero-three-mobile-final.png`
|
| 61 |
- Three.js pointer-motion frame: `/private/tmp/awesome-loop-hero-three-motion-final.png`
|
| 62 |
- Social preview: `/Users/chaoyue/Library/CloudStorage/Dropbox/Loop Engineering/awesome-loop-engineering/assets/social-preview.png`
|
| 63 |
|
| 64 |
-
## 2026-07-
|
| 65 |
|
| 66 |
- Desktop: 1440 x 1000, no horizontal overflow, no hero text/scene overlap, and all eight section headings render without requiring scroll-triggered opacity changes.
|
| 67 |
- Tablet: 768 x 900. The first pass clipped the intake and decision stations. The responsive camera now fits an 11.2-unit horizontal view between 720 px and 900 px, keeping all six stations, the retry path, and the outcome node inside the canvas.
|
| 68 |
- Phone: 390 x 844, no horizontal overflow. The compact loop keeps all six stations, the moving work packet, legend, outcome key, and stage selector visible without crossing the hero copy.
|
| 69 |
- Mobile navigation: opens all eight project links, reports `aria-expanded="true"`, closes on Escape, and restores focus to the menu button.
|
| 70 |
-
-
|
| 71 |
-
- Resource
|
|
|
|
| 72 |
- Scene motion: the canvas frame counter advanced from 640 to 662 over 900 ms. Two canvas crops taken 1.2 seconds apart changed 17.79% of sampled RGB channels.
|
| 73 |
-
- Scene pixels:
|
| 74 |
-
-
|
| 75 |
-
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
- Desktop before/after: `/tmp/loop-desktop-before-after.png`
|
| 80 |
-
- Tablet framing before/after: `/tmp/loop-tablet-before-after.png`
|
| 81 |
-
- Phone hero: `/tmp/loop-qa-mobile-after-fit.png`
|
| 82 |
-
- Phone Resource Atlas: `/tmp/loop-qa-mobile-resource-cards.png`
|
| 83 |
-
- Canvas frame 1: `/tmp/loop-motion-canvas-1.png`
|
| 84 |
-
- Canvas frame 2: `/tmp/loop-motion-canvas-2.png`
|
| 85 |
-
- Canvas pixel difference: `/tmp/loop-motion-diff.png`
|
| 86 |
|
| 87 |
final result: passed
|
|
|
|
| 12 |
|
| 13 |
## Viewports And States
|
| 14 |
|
| 15 |
+
- Desktop first viewport: 1440 x 1000, page top, sticky navigation and the complete six-station agent loop visible.
|
| 16 |
+
- Mobile first viewport: 390 x 844, page top, compact six-station scene, stage selector, and next-section cue visible without horizontal overflow.
|
| 17 |
+
- Mobile navigation: eight links visible when expanded; Escape closes the menu, updates `aria-expanded`, and restores focus.
|
| 18 |
+
- Pattern library: 20 symptom-first entries; mobile query `accessibility` returns exactly one matching pattern.
|
| 19 |
+
- Contract and lifecycle: purpose-built mobile summaries replace desktop-wide figures at 560 px and below.
|
| 20 |
+
- Runtime map: desktop figure plus eight labeled starters in a balanced 4 x 2 grid; mobile uses the explanatory copy and one-column starter sequence instead of shrinking the wide figure.
|
| 21 |
+
- Maturity model: desktop figure plus semantic levels 00-06; mobile keeps the readable level rows and hides the wide supporting figure.
|
| 22 |
+
- Social preview: 1280 x 640, exact 545-resource, 20-pattern, 20-contract, and 8-starter counts.
|
| 23 |
+
- Interactive hero, desktop: 1440 x 1000, one ready WebGL canvas, no horizontal overflow, and meaningful agent-system labels.
|
| 24 |
+
- Interactive hero, mobile: 390 x 844, one ready WebGL canvas, no horizontal overflow, and all six stations inside the frame.
|
| 25 |
- Interactive hero motion: the frame counter advanced by 47 frames during a 450 ms pointer-parallax check.
|
| 26 |
- Interactive hero efficiency: the frame counter advanced by zero during a 700 ms offscreen check at the Resources section.
|
| 27 |
|
|
|
|
| 37 |
8. Compared the published static hero and the Three.js-enhanced hero at the same 1280 x 720 viewport. The enhancement keeps the existing identity, copy, actions, spacing, and section transition while adding a restrained evidence orbit, control-plane stack, verification gate, and six lifecycle nodes behind the content.
|
| 38 |
9. Moved the control-plane stack and verification gate outward after the first 3D pass so they frame the copy rather than crossing its reading path. Rechecked desktop and mobile rendering after the adjustment.
|
| 39 |
10. Verified progressive enhancement behavior: the semantic hero remains complete without WebGL, forced-colors and print hide the scene, reduced-motion renders a static frame, and the animation stops when the hero leaves the viewport.
|
| 40 |
+
11. Expanded the implementation kit to 20 patterns, 20 validated contracts, and eight runtime starters. The runtime section now labels all five adaptable templates and all three executables, with use-case copy and an even desktop grid.
|
| 41 |
+
12. Rechecked the expanded pattern and runtime sections at 1440 x 1000 and 390 x 844. Anchor offsets clear the sticky header, the page width stays equal to the viewport, and headings, icons, labels, and descriptions remain aligned.
|
| 42 |
|
| 43 |
## Findings
|
| 44 |
|
|
|
|
| 51 |
|
| 52 |
## Focused Evidence
|
| 53 |
|
| 54 |
+
- Desktop hero: `/private/tmp/ale-site-v07-top-desktop.png`
|
| 55 |
+
- Mobile hero: `/private/tmp/ale-site-v07-top-mobile-final.png`
|
| 56 |
+
- Desktop pattern library: `/private/tmp/ale-site-v07-patterns-desktop.png`
|
| 57 |
+
- Mobile pattern library: `/private/tmp/ale-site-v07-patterns-mobile.png`
|
| 58 |
+
- Desktop runtime map and starter grid: `/private/tmp/ale-site-v07-runtime-desktop-final.png`
|
| 59 |
+
- Mobile runtime starters: `/private/tmp/ale-site-v07-runtime-mobile-final.png`
|
|
|
|
|
|
|
|
|
|
| 60 |
- Three.js pointer-motion frame: `/private/tmp/awesome-loop-hero-three-motion-final.png`
|
| 61 |
- Social preview: `/Users/chaoyue/Library/CloudStorage/Dropbox/Loop Engineering/awesome-loop-engineering/assets/social-preview.png`
|
| 62 |
|
| 63 |
+
## 2026-07-18 Repository Audit
|
| 64 |
|
| 65 |
- Desktop: 1440 x 1000, no horizontal overflow, no hero text/scene overlap, and all eight section headings render without requiring scroll-triggered opacity changes.
|
| 66 |
- Tablet: 768 x 900. The first pass clipped the intake and decision stations. The responsive camera now fits an 11.2-unit horizontal view between 720 px and 900 px, keeping all six stations, the retry path, and the outcome node inside the canvas.
|
| 67 |
- Phone: 390 x 844, no horizontal overflow. The compact loop keeps all six stations, the moving work packet, legend, outcome key, and stage selector visible without crossing the hero copy.
|
| 68 |
- Mobile navigation: opens all eight project links, reports `aria-expanded="true"`, closes on Escape, and restores focus to the menu button.
|
| 69 |
+
- Pattern filter: `accessibility` returns exactly one of the 20 patterns.
|
| 70 |
+
- Resource Atlas: remains idle above the fold, loads on approach or a direct resource anchor, and reports `545 of 545 resources | showing 8` on mobile.
|
| 71 |
+
- Resource interactions: `SWE-bench` returns 9 matches, the paper filter narrows those to 6, Reset restores all 545, and Show more expands the rendered set from 8 to 16.
|
| 72 |
- Scene motion: the canvas frame counter advanced from 640 to 662 over 900 ms. Two canvas crops taken 1.2 seconds apart changed 17.79% of sampled RGB channels.
|
| 73 |
+
- Scene pixels: the sampled desktop crop has 15.71% active pixels with RGB standard deviations of 35.83, 29.77, and 23.01; mobile has 27.84% active pixels with deviations of 41.27, 30.61, and 19.52. Both renders are nonblank and well contrasted.
|
| 74 |
+
- Runtime starters: desktop cards form two equal-height rows of four; mobile cards are 358 px wide within a 390 px document and preserve label, icon, heading, and copy alignment.
|
| 75 |
+
- Console: no page-origin errors or warnings during mobile navigation, pattern filtering, and Resource Atlas interactions.
|
| 76 |
+
- Source audit: 545 rows checked; 496 public sources reachable, 1 access-restricted, 48 repository-native, and 0 broken or unreachable as of 2026-07-17 UTC.
|
| 77 |
+
- Data and copy: the website, README, translations, social preview source, release copy, and Hugging Face card all report 545 resources, 20 patterns, 20 contracts, 8 runtime starters, and version 0.7.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
final result: passed
|
docs/assets/resources.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
docs/assets/social-preview-545-v07.png
ADDED
|
Git LFS Details
|
docs/assets/social-preview.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
docs/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
<title>Awesome Loop Engineering</title>
|
| 7 |
-
<meta name="description" content="
|
| 8 |
<meta name="robots" content="index,follow">
|
| 9 |
<meta name="author" content="Chaoyue He">
|
| 10 |
<link rel="canonical" href="https://chaoyue0307.github.io/awesome-loop-engineering/">
|
|
@@ -15,16 +15,16 @@
|
|
| 15 |
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
| 16 |
<meta property="og:type" content="website">
|
| 17 |
<meta property="og:title" content="Awesome Loop Engineering">
|
| 18 |
-
<meta property="og:description" content="
|
| 19 |
<meta property="og:url" content="https://chaoyue0307.github.io/awesome-loop-engineering/">
|
| 20 |
-
<meta property="og:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-
|
| 21 |
<meta property="og:image:width" content="1280">
|
| 22 |
<meta property="og:image:height" content="640">
|
| 23 |
<meta property="og:image:alt" content="Awesome Loop Engineering: design loops, not just prompts.">
|
| 24 |
<meta name="twitter:card" content="summary_large_image">
|
| 25 |
<meta name="twitter:title" content="Awesome Loop Engineering">
|
| 26 |
-
<meta name="twitter:description" content="
|
| 27 |
-
<meta name="twitter:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-
|
| 28 |
<link rel="alternate" type="application/atom+xml" title="Awesome Loop Engineering releases" href="https://github.com/ChaoYue0307/awesome-loop-engineering/releases.atom">
|
| 29 |
<link rel="alternate" type="application/atom+xml" title="Awesome Loop Engineering commits" href="https://github.com/ChaoYue0307/awesome-loop-engineering/commits/main.atom">
|
| 30 |
<style>
|
|
@@ -468,6 +468,17 @@
|
|
| 468 |
|
| 469 |
.card { display: block; color: var(--ink); text-decoration: none; }
|
| 470 |
a.card:hover { color: var(--blue); border-color: var(--blue); text-decoration: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
code {
|
| 472 |
border: 1px solid var(--line);
|
| 473 |
border-radius: 4px;
|
|
@@ -602,6 +613,11 @@
|
|
| 602 |
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 9px; background: var(--surface); color: var(--ink); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
|
| 603 |
.legal { margin: 30px 0 0; color: var(--quiet); font-size: 0.8rem; }
|
| 604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 605 |
@media (max-width: 1040px) {
|
| 606 |
.links { display: none; }
|
| 607 |
.menu-btn { display: inline-flex; }
|
|
@@ -943,7 +959,7 @@
|
|
| 943 |
"https://huggingface.co/datasets/cy0307/awesome-loop-engineering"
|
| 944 |
],
|
| 945 |
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
|
| 946 |
-
"image": "https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-
|
| 947 |
"logo": "https://chaoyue0307.github.io/awesome-loop-engineering/assets/awesome-loop-engineering-logo.png",
|
| 948 |
"author": { "@type": "Person", "name": "Chaoyue He" }
|
| 949 |
}
|
|
@@ -993,7 +1009,7 @@
|
|
| 993 |
"https://github.com/ChaoYue0307/awesome-loop-engineering"
|
| 994 |
],
|
| 995 |
"identifier": "https://huggingface.co/datasets/cy0307/awesome-loop-engineering",
|
| 996 |
-
"version": "0.
|
| 997 |
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
|
| 998 |
"isAccessibleForFree": true,
|
| 999 |
"creator": { "@type": "Person", "name": "Chaoyue He" },
|
|
@@ -1060,7 +1076,7 @@
|
|
| 1060 |
<p class="section-label hero-kicker"><i class="icon" data-lucide="repeat-2" aria-hidden="true"></i><span>Field guide for recurring agent systems</span></p>
|
| 1061 |
<h1>Awesome Loop Engineering</h1>
|
| 1062 |
<p class="tagline">Design loops, not just prompts.</p>
|
| 1063 |
-
<p class="lead">
|
| 1064 |
<div class="actions">
|
| 1065 |
<a class="button primary" href="https://github.com/ChaoYue0307/awesome-loop-engineering#readme"><i class="icon" data-lucide="book-open" aria-hidden="true"></i>Explore the list</a>
|
| 1066 |
<a class="button" href="#choose"><i class="icon" data-lucide="compass" aria-hidden="true"></i>Choose a loop</a>
|
|
@@ -1117,10 +1133,10 @@
|
|
| 1117 |
</div>
|
| 1118 |
</figure>
|
| 1119 |
<div class="stats" role="list" aria-label="Repository at a glance">
|
| 1120 |
-
<div class="stat" role="listitem"><b><i class="icon" data-lucide="library" aria-hidden="true"></i>
|
| 1121 |
-
<div class="stat" role="listitem"><b><i class="icon" data-lucide="blocks" aria-hidden="true"></i>
|
| 1122 |
-
<div class="stat" role="listitem"><b><i class="icon" data-lucide="file-check-2" aria-hidden="true"></i>
|
| 1123 |
-
<div class="stat" role="listitem"><b><i class="icon" data-lucide="play" aria-hidden="true"></i>
|
| 1124 |
<div class="stat" role="listitem"><b><i class="icon" data-lucide="languages" aria-hidden="true"></i>8</b><span>languages</span></div>
|
| 1125 |
</div>
|
| 1126 |
</div>
|
|
@@ -1133,7 +1149,7 @@
|
|
| 1133 |
<p class="section-label"><i class="icon" data-lucide="file-check-2" aria-hidden="true"></i><span>01 / The loop contract</span></p>
|
| 1134 |
<h2>Every reliable loop names the same parts.</h2>
|
| 1135 |
</div>
|
| 1136 |
-
<p class="section-intro">A loop contract makes triggers, permissions, verification, state, budgets, and human handoff reviewable. Start with the <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/schemas/loop-contract.schema.json">JSON schema</a> or one of <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/README.md">
|
| 1137 |
</div>
|
| 1138 |
<figure class="diagram desktop-diagram">
|
| 1139 |
<div class="diagram-scroll"><img src="assets/loop-contract-cards.svg" width="1200" height="720" loading="lazy" alt="Loop Contract: objective, trigger, intake, workspace, context, delegation, verification, state, budget, escalation, exit, and next action."></div>
|
|
@@ -1214,7 +1230,7 @@
|
|
| 1214 |
<p class="section-label"><i class="icon" data-lucide="blocks" aria-hidden="true"></i><span>03 / Pattern library</span></p>
|
| 1215 |
<h2>Start from the problem you have.</h2>
|
| 1216 |
</div>
|
| 1217 |
-
<p class="section-intro">
|
| 1218 |
</div>
|
| 1219 |
<div class="filter-row">
|
| 1220 |
<input type="search" id="pattern-filter" class="pattern-filter" placeholder="Filter patterns by keyword..." aria-label="Filter patterns by keyword" autocomplete="off">
|
|
@@ -1236,6 +1252,11 @@
|
|
| 1236 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/data-quality-loop.md"><span class="sym">"A dataset keeps drifting"</span><span class="name">Data-quality loop</span></a>
|
| 1237 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/release-note-loop.md"><span class="sym">"Release notes are a chore"</span><span class="name">Release-note loop</span></a>
|
| 1238 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/model-routing-loop.md"><span class="sym">"Model choice is ad hoc"</span><span class="name">Model-routing loop</span></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1239 |
</div>
|
| 1240 |
</div>
|
| 1241 |
</section>
|
|
@@ -1247,19 +1268,21 @@
|
|
| 1247 |
<p class="section-label"><i class="icon" data-lucide="wrench" aria-hidden="true"></i><span>04 / Where loops run</span></p>
|
| 1248 |
<h2>Pick the runtime deliberately.</h2>
|
| 1249 |
</div>
|
| 1250 |
-
<p class="section-intro">
|
| 1251 |
</div>
|
| 1252 |
<figure class="diagram supporting-visual">
|
| 1253 |
<div class="diagram-scroll"><img src="assets/loop-runtime-map.png" width="1666" height="944" loading="lazy" alt="Runtime map progressing from a nearby session to a local desktop schedule, isolated CI and cloud execution, and a recoverable durable worker."></div>
|
| 1254 |
<figcaption class="caption">Keep the contract stable; change the trigger, isolation, and permission wiring.</figcaption>
|
| 1255 |
</figure>
|
| 1256 |
<div class="link-grid">
|
| 1257 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/claude-loop.md"><h3><i class="icon" data-lucide="keyboard" aria-hidden="true"></i>Claude Code <code>/loop</code></h3><p>
|
| 1258 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/claude-desktop-scheduled-task.md"><h3><i class="icon" data-lucide="clock-3" aria-hidden="true"></i>Desktop scheduled task</h3><p>
|
| 1259 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/codex-automation.md"><h3><i class="icon" data-lucide="bot" aria-hidden="true"></i>Codex automation</h3><p>
|
| 1260 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/github-agentic-workflow.md"><h3><i class="icon" data-lucide="badge-check" aria-hidden="true"></i>GitHub agentic workflow</h3><p>
|
| 1261 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/shell-cron-loop.md"><h3><i class="icon" data-lucide="terminal" aria-hidden="true"></i>Shell / cron</h3><p>
|
| 1262 |
-
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/test-repair-loop.sh"><h3><i class="icon" data-lucide="play" aria-hidden="true"></i>
|
|
|
|
|
|
|
| 1263 |
</div>
|
| 1264 |
</div>
|
| 1265 |
</section>
|
|
@@ -1296,9 +1319,9 @@
|
|
| 1296 |
<p class="section-label"><i class="icon" data-lucide="library" aria-hidden="true"></i><span>06 / Resource atlas</span></p>
|
| 1297 |
<h2>Find evidence, not just links.</h2>
|
| 1298 |
</div>
|
| 1299 |
-
<p class="section-intro">Filter
|
| 1300 |
</div>
|
| 1301 |
-
<p class="audit-note"><strong>Audit snapshot, 2026-07-17:</strong> all
|
| 1302 |
<div class="resource-explorer" id="resource-explorer">
|
| 1303 |
<div class="resource-toolbar" role="search" aria-label="Search resources">
|
| 1304 |
<label>
|
|
@@ -1457,7 +1480,7 @@
|
|
| 1457 |
title = {Awesome Loop Engineering},
|
| 1458 |
year = {2026},
|
| 1459 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 1460 |
-
note = {Version 0.
|
| 1461 |
}</pre>
|
| 1462 |
</div>
|
| 1463 |
</div>
|
|
@@ -1850,7 +1873,7 @@
|
|
| 1850 |
loading = true;
|
| 1851 |
explorer.dataset.indexState = 'loading';
|
| 1852 |
list.setAttribute('aria-busy', 'true');
|
| 1853 |
-
count.textContent = 'Loading
|
| 1854 |
list.replaceChildren(createText('p', 'resource-loading', 'Loading audited resources...'));
|
| 1855 |
|
| 1856 |
fetch('assets/resources.json')
|
|
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
<title>Awesome Loop Engineering</title>
|
| 7 |
+
<meta name="description" content="545 source-audited resources, 20 patterns, 20 validated contracts, and 8 runtime starters for recurring, stateful, verified AI-agent systems.">
|
| 8 |
<meta name="robots" content="index,follow">
|
| 9 |
<meta name="author" content="Chaoyue He">
|
| 10 |
<link rel="canonical" href="https://chaoyue0307.github.io/awesome-loop-engineering/">
|
|
|
|
| 15 |
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
| 16 |
<meta property="og:type" content="website">
|
| 17 |
<meta property="og:title" content="Awesome Loop Engineering">
|
| 18 |
+
<meta property="og:description" content="545 source-audited resources, 20 patterns, 20 validated contracts, and 8 runtime starters for recurring, stateful, verified AI-agent systems.">
|
| 19 |
<meta property="og:url" content="https://chaoyue0307.github.io/awesome-loop-engineering/">
|
| 20 |
+
<meta property="og:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-545-v07.png">
|
| 21 |
<meta property="og:image:width" content="1280">
|
| 22 |
<meta property="og:image:height" content="640">
|
| 23 |
<meta property="og:image:alt" content="Awesome Loop Engineering: design loops, not just prompts.">
|
| 24 |
<meta name="twitter:card" content="summary_large_image">
|
| 25 |
<meta name="twitter:title" content="Awesome Loop Engineering">
|
| 26 |
+
<meta name="twitter:description" content="545 source-audited resources, 20 patterns, 20 validated contracts, and 8 runtime starters for recurring, stateful, verified AI-agent systems.">
|
| 27 |
+
<meta name="twitter:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-545-v07.png">
|
| 28 |
<link rel="alternate" type="application/atom+xml" title="Awesome Loop Engineering releases" href="https://github.com/ChaoYue0307/awesome-loop-engineering/releases.atom">
|
| 29 |
<link rel="alternate" type="application/atom+xml" title="Awesome Loop Engineering commits" href="https://github.com/ChaoYue0307/awesome-loop-engineering/commits/main.atom">
|
| 30 |
<style>
|
|
|
|
| 468 |
|
| 469 |
.card { display: block; color: var(--ink); text-decoration: none; }
|
| 470 |
a.card:hover { color: var(--blue); border-color: var(--blue); text-decoration: none; }
|
| 471 |
+
.runtime-kind {
|
| 472 |
+
display: block;
|
| 473 |
+
margin-bottom: 8px;
|
| 474 |
+
color: var(--blue);
|
| 475 |
+
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
| 476 |
+
font-size: 0.64rem;
|
| 477 |
+
font-weight: 650;
|
| 478 |
+
line-height: 1.2;
|
| 479 |
+
text-transform: uppercase;
|
| 480 |
+
}
|
| 481 |
+
.runtime-kind.executable { color: var(--green); }
|
| 482 |
code {
|
| 483 |
border: 1px solid var(--line);
|
| 484 |
border-radius: 4px;
|
|
|
|
| 613 |
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 9px; background: var(--surface); color: var(--ink); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
|
| 614 |
.legal { margin: 30px 0 0; color: var(--quiet); font-size: 0.8rem; }
|
| 615 |
|
| 616 |
+
@media (min-width: 1041px) {
|
| 617 |
+
#runtimes .link-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
| 618 |
+
#runtimes .card { padding-left: 22px; }
|
| 619 |
+
#runtimes .card:nth-child(4n+1) { padding-left: 0; }
|
| 620 |
+
}
|
| 621 |
@media (max-width: 1040px) {
|
| 622 |
.links { display: none; }
|
| 623 |
.menu-btn { display: inline-flex; }
|
|
|
|
| 959 |
"https://huggingface.co/datasets/cy0307/awesome-loop-engineering"
|
| 960 |
],
|
| 961 |
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
|
| 962 |
+
"image": "https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-545-v07.png",
|
| 963 |
"logo": "https://chaoyue0307.github.io/awesome-loop-engineering/assets/awesome-loop-engineering-logo.png",
|
| 964 |
"author": { "@type": "Person", "name": "Chaoyue He" }
|
| 965 |
}
|
|
|
|
| 1009 |
"https://github.com/ChaoYue0307/awesome-loop-engineering"
|
| 1010 |
],
|
| 1011 |
"identifier": "https://huggingface.co/datasets/cy0307/awesome-loop-engineering",
|
| 1012 |
+
"version": "0.7.0",
|
| 1013 |
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
|
| 1014 |
"isAccessibleForFree": true,
|
| 1015 |
"creator": { "@type": "Person", "name": "Chaoyue He" },
|
|
|
|
| 1076 |
<p class="section-label hero-kicker"><i class="icon" data-lucide="repeat-2" aria-hidden="true"></i><span>Field guide for recurring agent systems</span></p>
|
| 1077 |
<h1>Awesome Loop Engineering</h1>
|
| 1078 |
<p class="tagline">Design loops, not just prompts.</p>
|
| 1079 |
+
<p class="lead">545 source-audited resources, 20 operational patterns, 20 validated contracts, and 8 runtime starters for agent systems that must keep working.</p>
|
| 1080 |
<div class="actions">
|
| 1081 |
<a class="button primary" href="https://github.com/ChaoYue0307/awesome-loop-engineering#readme"><i class="icon" data-lucide="book-open" aria-hidden="true"></i>Explore the list</a>
|
| 1082 |
<a class="button" href="#choose"><i class="icon" data-lucide="compass" aria-hidden="true"></i>Choose a loop</a>
|
|
|
|
| 1133 |
</div>
|
| 1134 |
</figure>
|
| 1135 |
<div class="stats" role="list" aria-label="Repository at a glance">
|
| 1136 |
+
<div class="stat" role="listitem"><b><i class="icon" data-lucide="library" aria-hidden="true"></i>545</b><span>audited resources</span></div>
|
| 1137 |
+
<div class="stat" role="listitem"><b><i class="icon" data-lucide="blocks" aria-hidden="true"></i>20</b><span>operational patterns</span></div>
|
| 1138 |
+
<div class="stat" role="listitem"><b><i class="icon" data-lucide="file-check-2" aria-hidden="true"></i>20</b><span>loop contracts</span></div>
|
| 1139 |
+
<div class="stat" role="listitem"><b><i class="icon" data-lucide="play" aria-hidden="true"></i>8</b><span>runtime starters</span></div>
|
| 1140 |
<div class="stat" role="listitem"><b><i class="icon" data-lucide="languages" aria-hidden="true"></i>8</b><span>languages</span></div>
|
| 1141 |
</div>
|
| 1142 |
</div>
|
|
|
|
| 1149 |
<p class="section-label"><i class="icon" data-lucide="file-check-2" aria-hidden="true"></i><span>01 / The loop contract</span></p>
|
| 1150 |
<h2>Every reliable loop names the same parts.</h2>
|
| 1151 |
</div>
|
| 1152 |
+
<p class="section-intro">A loop contract makes triggers, permissions, verification, state, budgets, and human handoff reviewable. Start with the <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/schemas/loop-contract.schema.json">JSON schema</a> or one of <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/README.md">20 validated examples</a>.</p>
|
| 1153 |
</div>
|
| 1154 |
<figure class="diagram desktop-diagram">
|
| 1155 |
<div class="diagram-scroll"><img src="assets/loop-contract-cards.svg" width="1200" height="720" loading="lazy" alt="Loop Contract: objective, trigger, intake, workspace, context, delegation, verification, state, budget, escalation, exit, and next action."></div>
|
|
|
|
| 1230 |
<p class="section-label"><i class="icon" data-lucide="blocks" aria-hidden="true"></i><span>03 / Pattern library</span></p>
|
| 1231 |
<h2>Start from the problem you have.</h2>
|
| 1232 |
</div>
|
| 1233 |
+
<p class="section-intro">Choose from 20 build, operate, optimize, and govern patterns. Each includes a trigger, evidence gate, durable state, budget, escalation path, worked scenario, and validated contract.</p>
|
| 1234 |
</div>
|
| 1235 |
<div class="filter-row">
|
| 1236 |
<input type="search" id="pattern-filter" class="pattern-filter" placeholder="Filter patterns by keyword..." aria-label="Filter patterns by keyword" autocomplete="off">
|
|
|
|
| 1252 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/data-quality-loop.md"><span class="sym">"A dataset keeps drifting"</span><span class="name">Data-quality loop</span></a>
|
| 1253 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/release-note-loop.md"><span class="sym">"Release notes are a chore"</span><span class="name">Release-note loop</span></a>
|
| 1254 |
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/model-routing-loop.md"><span class="sym">"Model choice is ad hoc"</span><span class="name">Model-routing loop</span></a>
|
| 1255 |
+
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/benchmark-optimization-loop.md"><span class="sym">"A stable system should improve"</span><span class="name">Benchmark optimization</span></a>
|
| 1256 |
+
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/knowledge-freshness-loop.md"><span class="sym">"The agent's knowledge is stale"</span><span class="name">Knowledge freshness</span></a>
|
| 1257 |
+
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/performance-regression-loop.md"><span class="sym">"Performance regressed"</span><span class="name">Performance regression</span></a>
|
| 1258 |
+
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/accessibility-regression-loop.md"><span class="sym">"Accessibility checks failed"</span><span class="name">Accessibility regression</span></a>
|
| 1259 |
+
<a class="pattern" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/adversarial-red-team-loop.md"><span class="sym">"The agent needs adversarial testing"</span><span class="name">Adversarial red team</span></a>
|
| 1260 |
</div>
|
| 1261 |
</div>
|
| 1262 |
</section>
|
|
|
|
| 1268 |
<p class="section-label"><i class="icon" data-lucide="wrench" aria-hidden="true"></i><span>04 / Where loops run</span></p>
|
| 1269 |
<h2>Pick the runtime deliberately.</h2>
|
| 1270 |
</div>
|
| 1271 |
+
<p class="section-intro">Five adaptable templates cover sessions, schedules, worktrees, Actions, and cron. Three executables demonstrate test repair, threshold monitoring, and idempotent queue work. The <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/meta/RUNTIME_SELECTION.md">runtime selection guide</a> compares persistence, file access, isolation, and permissions.</p>
|
| 1272 |
</div>
|
| 1273 |
<figure class="diagram supporting-visual">
|
| 1274 |
<div class="diagram-scroll"><img src="assets/loop-runtime-map.png" width="1666" height="944" loading="lazy" alt="Runtime map progressing from a nearby session to a local desktop schedule, isolated CI and cloud execution, and a recoverable durable worker."></div>
|
| 1275 |
<figcaption class="caption">Keep the contract stable; change the trigger, isolation, and permission wiring.</figcaption>
|
| 1276 |
</figure>
|
| 1277 |
<div class="link-grid">
|
| 1278 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/claude-loop.md"><span class="runtime-kind">Adaptable template</span><h3><i class="icon" data-lucide="keyboard" aria-hidden="true"></i>Claude Code <code>/loop</code></h3><p>Use while present in a coding session; repeat a bounded command and keep progress in a file.</p></a>
|
| 1279 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/claude-desktop-scheduled-task.md"><span class="runtime-kind">Adaptable template</span><h3><i class="icon" data-lucide="clock-3" aria-hidden="true"></i>Desktop scheduled task</h3><p>Use when local files need a schedule, a last-run marker, and missed-run guardrails.</p></a>
|
| 1280 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/codex-automation.md"><span class="runtime-kind">Adaptable template</span><h3><i class="icon" data-lucide="bot" aria-hidden="true"></i>Codex automation</h3><p>Use for isolated background repository work with declared checks and reviewable receipts.</p></a>
|
| 1281 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/github-agentic-workflow.md"><span class="runtime-kind">Adaptable template</span><h3><i class="icon" data-lucide="badge-check" aria-hidden="true"></i>GitHub agentic workflow</h3><p>Use when GitHub events or cron should produce issues, artifacts, or pull requests.</p></a>
|
| 1282 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/shell-cron-loop.md"><span class="runtime-kind">Adaptable template</span><h3><i class="icon" data-lucide="terminal" aria-hidden="true"></i>Shell / cron</h3><p>Use when an existing agent CLI only needs OS scheduling, locks, and a progress file.</p></a>
|
| 1283 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/test-repair-loop.sh"><span class="runtime-kind executable">Executable</span><h3><i class="icon" data-lucide="play" aria-hidden="true"></i>Test repair</h3><p>Run a failing command, delegate its evidence, and stop only when that same external check passes.</p></a>
|
| 1284 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/threshold-monitor-loop.sh"><span class="runtime-kind executable">Executable</span><h3><i class="icon" data-lucide="activity" aria-hidden="true"></i>Threshold monitor</h3><p>Poll a metric, persist samples, and escalate on a breached boundary without auto-remediation.</p></a>
|
| 1285 |
+
<a class="card" href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/runnable/queue-worker-loop.py"><span class="runtime-kind executable">Executable</span><h3><i class="icon" data-lucide="list-checks" aria-hidden="true"></i>Queue worker</h3><p>Process bounded JSONL work items with external verification and durable receipts.</p></a>
|
| 1286 |
</div>
|
| 1287 |
</div>
|
| 1288 |
</section>
|
|
|
|
| 1319 |
<p class="section-label"><i class="icon" data-lucide="library" aria-hidden="true"></i><span>06 / Resource atlas</span></p>
|
| 1320 |
<h2>Find evidence, not just links.</h2>
|
| 1321 |
</div>
|
| 1322 |
+
<p class="section-intro">Filter 545 source-audited works by goal, lifecycle, artifact type, and evidence class. Open any result for contribution, novelty, impact, provenance, and source metadata.</p>
|
| 1323 |
</div>
|
| 1324 |
+
<p class="audit-note"><strong>Audit snapshot, 2026-07-17 UTC:</strong> all 545 rows checked; 496 public sources reachable, 1 access-restricted, 48 repository-native, and 0 broken or unreachable. <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/data/resource_source_audit.csv">Inspect the audit</a> or <a href="https://github.com/ChaoYue0307/awesome-loop-engineering/issues/new?template=annotation-correction.yml">report a correction</a>.</p>
|
| 1325 |
<div class="resource-explorer" id="resource-explorer">
|
| 1326 |
<div class="resource-toolbar" role="search" aria-label="Search resources">
|
| 1327 |
<label>
|
|
|
|
| 1480 |
title = {Awesome Loop Engineering},
|
| 1481 |
year = {2026},
|
| 1482 |
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}},
|
| 1483 |
+
note = {Version 0.7.0}
|
| 1484 |
}</pre>
|
| 1485 |
</div>
|
| 1486 |
</div>
|
|
|
|
| 1873 |
loading = true;
|
| 1874 |
explorer.dataset.indexState = 'loading';
|
| 1875 |
list.setAttribute('aria-busy', 'true');
|
| 1876 |
+
count.textContent = 'Loading 545 audited resources...';
|
| 1877 |
list.replaceChildren(createText('p', 'resource-loading', 'Loading audited resources...'));
|
| 1878 |
|
| 1879 |
fetch('assets/resources.json')
|
docs/sitemap.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
| 3 |
<url>
|
| 4 |
<loc>https://chaoyue0307.github.io/awesome-loop-engineering/</loc>
|
| 5 |
-
<lastmod>2026-07-
|
| 6 |
<changefreq>weekly</changefreq>
|
| 7 |
<priority>1.0</priority>
|
| 8 |
</url>
|
|
|
|
| 2 |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
| 3 |
<url>
|
| 4 |
<loc>https://chaoyue0307.github.io/awesome-loop-engineering/</loc>
|
| 5 |
+
<lastmod>2026-07-18</lastmod>
|
| 6 |
<changefreq>weekly</changefreq>
|
| 7 |
<priority>1.0</priority>
|
| 8 |
</url>
|
docs/{x-v06-540.html → x-v07-545.html}
RENAMED
|
@@ -3,23 +3,23 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
-
<title>Awesome Loop Engineering:
|
| 7 |
-
<meta name="description" content="A source-audited field guide with
|
| 8 |
<meta name="robots" content="noindex,follow">
|
| 9 |
-
<link rel="canonical" href="https://chaoyue0307.github.io/awesome-loop-engineering/x-
|
| 10 |
<meta property="og:type" content="website">
|
| 11 |
<meta property="og:title" content="Awesome Loop Engineering">
|
| 12 |
-
<meta property="og:description" content="
|
| 13 |
-
<meta property="og:url" content="https://chaoyue0307.github.io/awesome-loop-engineering/x-
|
| 14 |
-
<meta property="og:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-
|
| 15 |
<meta property="og:image:width" content="1280">
|
| 16 |
<meta property="og:image:height" content="640">
|
| 17 |
-
<meta property="og:image:alt" content="Awesome Loop Engineering: design loops, not just prompts.
|
| 18 |
<meta name="twitter:card" content="summary_large_image">
|
| 19 |
<meta name="twitter:title" content="Awesome Loop Engineering">
|
| 20 |
-
<meta name="twitter:description" content="
|
| 21 |
-
<meta name="twitter:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-
|
| 22 |
-
<meta name="twitter:image:alt" content="Awesome Loop Engineering:
|
| 23 |
<link rel="icon" href="assets/favicon-32.png" type="image/png" sizes="32x32">
|
| 24 |
<style>
|
| 25 |
:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
|
|
@@ -30,7 +30,7 @@
|
|
| 30 |
a { color: #1d4ed8; font-weight: 700; }
|
| 31 |
</style>
|
| 32 |
<script>
|
| 33 |
-
window.location.replace("https://chaoyue0307.github.io/awesome-loop-engineering/?utm_source=x&utm_medium=social&utm_campaign=v0.
|
| 34 |
</script>
|
| 35 |
</head>
|
| 36 |
<body>
|
|
@@ -38,7 +38,7 @@
|
|
| 38 |
<img src="assets/awesome-loop-engineering-logo.png" alt="Awesome Loop Engineering">
|
| 39 |
<h1>Awesome Loop Engineering</h1>
|
| 40 |
<p>Opening the interactive Resource Atlas.</p>
|
| 41 |
-
<p><a href="https://chaoyue0307.github.io/awesome-loop-engineering/?utm_source=x&utm_medium=social&utm_campaign=v0.
|
| 42 |
</main>
|
| 43 |
</body>
|
| 44 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>Awesome Loop Engineering: 545 source-audited resources</title>
|
| 7 |
+
<meta name="description" content="A source-audited field guide with 545 resources, 20 operational patterns, 20 validated contracts, and 8 runtime starters for recurring AI-agent systems.">
|
| 8 |
<meta name="robots" content="noindex,follow">
|
| 9 |
+
<link rel="canonical" href="https://chaoyue0307.github.io/awesome-loop-engineering/x-v07-545.html">
|
| 10 |
<meta property="og:type" content="website">
|
| 11 |
<meta property="og:title" content="Awesome Loop Engineering">
|
| 12 |
+
<meta property="og:description" content="545 source-audited resources, 20 operational patterns, 20 validated contracts, and 8 runtime starters for recurring AI-agent systems.">
|
| 13 |
+
<meta property="og:url" content="https://chaoyue0307.github.io/awesome-loop-engineering/x-v07-545.html">
|
| 14 |
+
<meta property="og:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-545-v07.png">
|
| 15 |
<meta property="og:image:width" content="1280">
|
| 16 |
<meta property="og:image:height" content="640">
|
| 17 |
+
<meta property="og:image:alt" content="Awesome Loop Engineering: design loops, not just prompts. 545 source-audited resources, 20 patterns, 20 contracts, and 8 runtime starters.">
|
| 18 |
<meta name="twitter:card" content="summary_large_image">
|
| 19 |
<meta name="twitter:title" content="Awesome Loop Engineering">
|
| 20 |
+
<meta name="twitter:description" content="545 source-audited resources and a 20-pattern implementation kit for recurring, stateful, verified AI-agent systems.">
|
| 21 |
+
<meta name="twitter:image" content="https://chaoyue0307.github.io/awesome-loop-engineering/assets/social-preview-545-v07.png">
|
| 22 |
+
<meta name="twitter:image:alt" content="Awesome Loop Engineering: 545 source-audited resources, 20 patterns, 20 contracts, and 8 runtime starters.">
|
| 23 |
<link rel="icon" href="assets/favicon-32.png" type="image/png" sizes="32x32">
|
| 24 |
<style>
|
| 25 |
:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
|
|
|
|
| 30 |
a { color: #1d4ed8; font-weight: 700; }
|
| 31 |
</style>
|
| 32 |
<script>
|
| 33 |
+
window.location.replace("https://chaoyue0307.github.io/awesome-loop-engineering/?utm_source=x&utm_medium=social&utm_campaign=v0.7.0");
|
| 34 |
</script>
|
| 35 |
</head>
|
| 36 |
<body>
|
|
|
|
| 38 |
<img src="assets/awesome-loop-engineering-logo.png" alt="Awesome Loop Engineering">
|
| 39 |
<h1>Awesome Loop Engineering</h1>
|
| 40 |
<p>Opening the interactive Resource Atlas.</p>
|
| 41 |
+
<p><a href="https://chaoyue0307.github.io/awesome-loop-engineering/?utm_source=x&utm_medium=social&utm_campaign=v0.7.0">Continue to the site</a></p>
|
| 42 |
</main>
|
| 43 |
</body>
|
| 44 |
</html>
|
examples/README.md
CHANGED
|
@@ -1,90 +1,141 @@
|
|
| 1 |
-
# Loop
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
| 10 |
-
- [`ci-repair-loop.json`](ci-repair-loop.json)
|
| 11 |
-
- [`docs-drift-loop.json`](docs-drift-loop.json)
|
| 12 |
-
- [`deploy-verifier-loop.json`](deploy-verifier-loop.json)
|
| 13 |
-
- [`feedback-clusterer-loop.json`](feedback-clusterer-loop.json)
|
| 14 |
-
- [`dependency-triage-loop.json`](dependency-triage-loop.json)
|
| 15 |
-
- [`evaluation-regression-loop.json`](evaluation-regression-loop.json)
|
| 16 |
-
- [`security-review-loop.json`](security-review-loop.json)
|
| 17 |
-
- [`cost-control-loop.json`](cost-control-loop.json)
|
| 18 |
-
- [`bug-hunting-loop.json`](bug-hunting-loop.json)
|
| 19 |
-
- [`enterprise-approval-loop.json`](enterprise-approval-loop.json)
|
| 20 |
-
- [`incident-response-loop.json`](incident-response-loop.json)
|
| 21 |
-
- [`data-quality-loop.json`](data-quality-loop.json)
|
| 22 |
-
- [`release-note-loop.json`](release-note-loop.json)
|
| 23 |
-
- [`model-routing-loop.json`](model-routing-loop.json)
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
##
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
```
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
- unresolved comments are answered or resolved;
|
| 49 |
-
- merge conflicts are gone;
|
| 50 |
-
- diff is limited to the stated blocker.
|
| 51 |
|
| 52 |
-
##
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
Identify the exact failing command or closest local equivalent.
|
| 61 |
-
Patch only the smallest log-backed cause, rerun the failing command first, and summarize evidence.
|
| 62 |
-
Escalate instead of changing tests, broad CI config, dependencies, or unrelated files without proof.
|
| 63 |
```
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
| 68 |
-
- the patch is limited to the failure cause;
|
| 69 |
-
- behavior changes include focused tests;
|
| 70 |
-
- the report includes the failing log excerpt and passing output.
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
```
|
| 84 |
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
-
|
| 88 |
-
-
|
| 89 |
-
-
|
| 90 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Validated Loop Contracts
|
| 2 |
|
| 3 |
+
Twenty JSON examples turn the operational patterns into reviewable machine-readable contracts. Every file validates against [`schemas/loop-contract.schema.json`](../schemas/loop-contract.schema.json) in CI.
|
| 4 |
|
| 5 |
+
A pattern explains **how a class of loop should operate**. Its contract pins down **what one implementation may read, change, verify, spend, and escalate**. A [runtime starter](runnable/README.md) then wires that contract to a session, schedule, CI job, or durable worker.
|
| 6 |
|
| 7 |
+
## Contract Catalog
|
| 8 |
|
| 9 |
+
### Build And Maintain
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
| Pattern and contract | Use when | Trigger | Deterministic gate | Durable receipt |
|
| 12 |
+
| --- | --- | --- | --- | --- |
|
| 13 |
+
| [PR babysitter](../patterns/pr-babysitter.md) · [`JSON`](pr-babysitter-loop.json) | A PR stalls on comments, CI, or conflicts | PR event + schedule | Required checks pass and review threads are resolved | Last SHA, check URLs, thread status, blockers |
|
| 14 |
+
| [CI repair](../patterns/ci-repair-loop.md) · [`JSON`](ci-repair-loop.json) | A required check fails | CI failure event | Original failing command passes | Failure excerpt, patch, commands, passing output |
|
| 15 |
+
| [Docs drift](../patterns/docs-drift-collector.md) · [`JSON`](docs-drift-loop.json) | Docs may disagree with code | Weekly schedule | Examples and links pass against current behavior | Verified drift items and false positives |
|
| 16 |
+
| [Dependency triage](../patterns/dependency-triage-loop.md) · [`JSON`](dependency-triage-loop.json) | Update PRs accumulate | Weekly + bot PR events | Tests, build, typecheck, and audit pass | Update group, risk class, commands, deferral reason |
|
| 17 |
+
| [Bug hunting](../patterns/bug-hunting-loop.md) · [`JSON`](bug-hunting-loop.json) | A team needs recurring bug discovery | Weekly schedule | Reproducible steps or a failing test | Checked surface, trace, minimal reproduction |
|
| 18 |
+
| [Release notes](../patterns/release-note-loop.md) · [`JSON`](release-note-loop.json) | A release needs evidence-backed notes | Tag or release branch | Every entry links to a merged source | Processed PRs/issues and draft changelog |
|
| 19 |
|
| 20 |
+
### Operate And Observe
|
| 21 |
|
| 22 |
+
| Pattern and contract | Use when | Trigger | Deterministic gate | Durable receipt |
|
| 23 |
+
| --- | --- | --- | --- | --- |
|
| 24 |
+
| [Deploy verifier](../patterns/deploy-verifier.md) · [`JSON`](deploy-verifier-loop.json) | A rollout needs monitoring | Deployment event + polling | Synthetic checks and thresholds hold | Rollout phase, anomalies, metric links, decision |
|
| 25 |
+
| [Incident response](../patterns/incident-response-loop.md) · [`JSON`](incident-response-loop.json) | An alert needs evidence and ownership | Pager or SLO event | Severity and cause cite concrete impact signals | Timeline, hypotheses, owner, handoff |
|
| 26 |
+
| [Data quality](../patterns/data-quality-loop.md) · [`JSON`](data-quality-loop.json) | A dataset refresh may drift | Refresh event or nightly | Hard schema and quality rules pass | Profile metrics, exceptions, quarantine decision |
|
| 27 |
+
| [Cost control](../patterns/cost-control-loop.md) · [`JSON`](cost-control-loop.json) | Agent spend rises | Schedule + spend threshold | Quality holds on a comparable sample | Baseline spend, traces, proposed savings |
|
| 28 |
+
| [Model routing](../patterns/model-routing-loop.md) · [`JSON`](model-routing-loop.json) | Model selection is inconsistent | Schedule + model/price change | Replay quality stays within tolerance | Task-class metrics and routing decision |
|
| 29 |
+
| [Performance regression](../patterns/performance-regression-loop.md) · [`JSON`](performance-regression-loop.json) | Latency, throughput, or memory worsens | Metric or benchmark regression | Correctness passes and repeated measurements recover | Environment, profile, samples, candidate decision |
|
| 30 |
|
| 31 |
+
### Learn And Optimize
|
| 32 |
|
| 33 |
+
| Pattern and contract | Use when | Trigger | Deterministic gate | Durable receipt |
|
| 34 |
+
| --- | --- | --- | --- | --- |
|
| 35 |
+
| [Feedback clusterer](../patterns/feedback-clusterer.md) · [`JSON`](feedback-clusterer-loop.json) | Feedback is noisy | Daily or weekly schedule | Themes cite sources and preserve frequency/severity | Processed IDs, clusters, outliers |
|
| 36 |
+
| [Evaluation regression](../patterns/evaluation-regression-loop.md) · [`JSON`](evaluation-regression-loop.json) | Agent evals fall below baseline | Nightly + score drop | Targeted tasks recover without scorer changes | Run IDs, traces, hypotheses, rerun scores |
|
| 37 |
+
| [Benchmark optimization](../patterns/benchmark-optimization-loop.md) · [`JSON`](benchmark-optimization-loop.json) | A stable system should improve | Bounded experiment window | Repeated gain with correctness and protected metrics intact | Hypothesis, diff, raw scores, cost, decision |
|
| 38 |
+
| [Knowledge freshness](../patterns/knowledge-freshness-loop.md) · [`JSON`](knowledge-freshness-loop.json) | An agent retrieval corpus is stale | Daily refresh + source change | Provenance, freshness, retrieval, and leakage gates pass | Manifest diff, checksums, evals, promotion pointer |
|
| 39 |
|
| 40 |
+
### Govern And Protect
|
| 41 |
|
| 42 |
+
| Pattern and contract | Use when | Trigger | Deterministic gate | Durable receipt |
|
| 43 |
+
| --- | --- | --- | --- | --- |
|
| 44 |
+
| [Security review](../patterns/security-review-loop.md) · [`JSON`](security-review-loop.json) | A sensitive diff needs review | Sensitive change + weekly sweep | Findings cite reproducible evidence | Reviewed SHA, findings, false positives |
|
| 45 |
+
| [Enterprise approval](../patterns/enterprise-approval-loop.md) · [`JSON`](enterprise-approval-loop.json) | A change needs formal sign-off | Gate or approver event | Every required gate has a human decision | Approval ledger, status, SLA, owner |
|
| 46 |
+
| [Accessibility regression](../patterns/accessibility-regression-loop.md) · [`JSON`](accessibility-regression-loop.json) | A UI accessibility check fails | PR or preview failure | Exact rule plus required human criteria pass | Before/after scan, interaction trace, reviewer decision |
|
| 47 |
+
| [Adversarial red team](../patterns/adversarial-red-team-loop.md) · [`JSON`](adversarial-red-team-loop.json) | An agent needs active security testing | Pre-release campaign | Independent reproduction and policy citation | Seed, full/minimized trace, severity, disclosure status |
|
| 48 |
+
|
| 49 |
+
## Read And Validate A Contract
|
| 50 |
+
|
| 51 |
+
Preview a contract as a compact human-readable checklist:
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
python3 scripts/preview_loop_contract.py examples/ci-repair-loop.json
|
| 55 |
```
|
| 56 |
|
| 57 |
+
Validate the complete contract library with the dependency-free CI validator:
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
python3 scripts/check_loop_contract_examples.py
|
| 61 |
+
```
|
| 62 |
|
| 63 |
+
## Four Worked Paths
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
### 1. Repair A Failing Check
|
| 66 |
|
| 67 |
+
**Symptom:** a pull request's `pytest -x` job is red.
|
| 68 |
|
| 69 |
+
1. Choose the [CI repair pattern](../patterns/ci-repair-loop.md).
|
| 70 |
+
1. Adapt [`ci-repair-loop.json`](ci-repair-loop.json): set the event trigger, protected files, three-retry budget, and escalation owner.
|
| 71 |
+
1. Run the [test-repair starter](runnable/test-repair-loop.sh) in an isolated worktree:
|
| 72 |
|
| 73 |
+
```bash
|
| 74 |
+
CHECK_CMD="pytest -x" AGENT_CMD="codex exec" ./examples/runnable/test-repair-loop.sh
|
|
|
|
|
|
|
|
|
|
| 75 |
```
|
| 76 |
|
| 77 |
+
**Done means:** the original command passes. The agent's claim is not the gate.
|
| 78 |
|
| 79 |
+
### 2. Refresh A Support Knowledge Base
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
**Symptom:** answers cite policies and release notes that may be stale.
|
| 82 |
|
| 83 |
+
1. Choose the [knowledge freshness pattern](../patterns/knowledge-freshness-loop.md).
|
| 84 |
+
1. Adapt [`knowledge-freshness-loop.json`](knowledge-freshness-loop.json): name approved sources, freshness windows, retrieval evals, leakage checks, and atomic promotion.
|
| 85 |
+
1. Schedule it with the [Codex automation](runnable/codex-automation.md), [desktop task](runnable/claude-desktop-scheduled-task.md), or your durable worker.
|
| 86 |
|
| 87 |
+
**Done means:** a versioned candidate passes provenance, freshness, retrieval, and sensitive-data gates before promotion. A successful fetch alone is not enough.
|
| 88 |
|
| 89 |
+
### 3. Process A Bounded Work Queue
|
| 90 |
+
|
| 91 |
+
**Symptom:** a set of narrow, independently verifiable tasks needs unattended handling.
|
| 92 |
+
|
| 93 |
+
Create `tasks.jsonl`:
|
| 94 |
+
|
| 95 |
+
```json
|
| 96 |
+
{"id":"docs-101","objective":"Update the CLI install example","context":["README.md","src/cli.ts"],"allowed_paths":["README.md"],"verification":"python3 scripts/check_docs.py"}
|
| 97 |
+
{"id":"schema-204","objective":"Add the missing status enum test","context":["schemas/status.json","tests/test_status.py"],"allowed_paths":["tests/test_status.py"],"verification":"pytest tests/test_status.py -q"}
|
| 98 |
```
|
| 99 |
|
| 100 |
+
Validate the queue first, then run a bounded batch:
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
python3 examples/runnable/queue-worker-loop.py --queue tasks.jsonl --dry-run
|
| 104 |
+
python3 examples/runnable/queue-worker-loop.py \
|
| 105 |
+
--queue tasks.jsonl \
|
| 106 |
+
--agent-command "codex exec" \
|
| 107 |
+
--verify-command "python3 verify_item.py {id}" \
|
| 108 |
+
--max-items 2 \
|
| 109 |
+
--max-retries 2 \
|
| 110 |
+
--command-timeout 900
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
**Done means:** the external verifier exits successfully and the item ID is persisted in `QUEUE_PROGRESS.jsonl`; reruns skip completed work.
|
| 114 |
+
|
| 115 |
+
### 4. Watch A Threshold Without Auto-Remediation
|
| 116 |
+
|
| 117 |
+
**Symptom:** a rollout, latency metric, pass rate, or spend metric needs bounded monitoring and evidence-backed escalation.
|
| 118 |
+
|
| 119 |
+
```bash
|
| 120 |
+
PROBE_CMD="./scripts/p95_latency_ms.sh" \
|
| 121 |
+
THRESHOLD=250 \
|
| 122 |
+
DIRECTION=max \
|
| 123 |
+
MAX_SAMPLES=12 \
|
| 124 |
+
INTERVAL_SECONDS=300 \
|
| 125 |
+
AGENT_CMD="codex exec" \
|
| 126 |
+
./examples/runnable/threshold-monitor-loop.sh
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
**Done means:** all samples stay within policy, or the first breach produces a durable receipt and read-only diagnosis. The starter never changes production.
|
| 130 |
+
|
| 131 |
+
## Adaptation Checklist
|
| 132 |
+
|
| 133 |
+
Before running any contract unattended:
|
| 134 |
|
| 135 |
+
- replace every generic source, command, file, and destination with a real one;
|
| 136 |
+
- keep the acting agent away from tests, scorers, policies, or thresholds that judge its work;
|
| 137 |
+
- narrow allowed paths, tools, credentials, and network access;
|
| 138 |
+
- make receipts reviewable and safe to retain;
|
| 139 |
+
- set time, retry, token, cost, and concurrency budgets;
|
| 140 |
+
- test the escalation path before trusting the success path;
|
| 141 |
+
- run first in a branch, worktree, sandbox, synthetic target, or read-only mode.
|
examples/accessibility-regression-loop.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Accessibility regression loop",
|
| 3 |
+
"objective": "Repair a newly introduced accessibility failure with reproducible automated evidence and required human review.",
|
| 4 |
+
"trigger": {
|
| 5 |
+
"type": "event",
|
| 6 |
+
"cadence_or_event": "An accessibility check fails on a pull request or deployment preview."
|
| 7 |
+
},
|
| 8 |
+
"intake": {
|
| 9 |
+
"sources": ["failing rule and selector", "route and viewport", "browser trace or screenshot", "changed diff", "manual accessibility checklist"],
|
| 10 |
+
"selection_rule": "Work only on a reproducible regression tied to the reported route, viewport, browser, and interaction."
|
| 11 |
+
},
|
| 12 |
+
"workspace": {
|
| 13 |
+
"isolation": "Branch or clean worktree based on the failing commit.",
|
| 14 |
+
"allowed_actions": ["run accessibility and interaction tests", "edit the affected component", "add focused regression tests", "record before and after evidence"],
|
| 15 |
+
"disallowed_actions": ["disable accessibility rules", "hide content from assistive technology", "lower thresholds", "change shared design tokens without owner approval"]
|
| 16 |
+
},
|
| 17 |
+
"context": {
|
| 18 |
+
"required_files": ["design-system accessibility guidance", "component tests", "WCAG review checklist", "project contribution rules"],
|
| 19 |
+
"runtime_sources": ["automated scan result", "keyboard path", "accessible tree snapshot", "deployment preview"]
|
| 20 |
+
},
|
| 21 |
+
"agents": [
|
| 22 |
+
{
|
| 23 |
+
"role": "Reproducer",
|
| 24 |
+
"responsibility": "Confirm the failure on the exact route, browser, viewport, and interaction."
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"role": "Fixer",
|
| 28 |
+
"responsibility": "Apply the smallest standards-aligned component or style change."
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"role": "Verifier",
|
| 32 |
+
"responsibility": "Rerun the focused automated rule, keyboard path, and adjacent tests."
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"role": "Accessibility reviewer",
|
| 36 |
+
"responsibility": "Judge manual criteria and ambiguous semantic or assistive-technology behavior."
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verification": {
|
| 40 |
+
"gates": ["original rule passes in the same environment", "keyboard order and visible focus remain coherent", "accessible name role and state are correct", "no rule or threshold was weakened", "required manual review is approved"],
|
| 41 |
+
"receipts": ["before and after scan", "route browser and viewport", "commands run", "interaction trace or screenshot", "named manual-review decision"]
|
| 42 |
+
},
|
| 43 |
+
"state": {
|
| 44 |
+
"artifacts": ["accessibility regression note", "test artifact", "manual review record"],
|
| 45 |
+
"update_rule": "Record the affected users, rule, reproduction, patch, automated result, and outstanding manual criteria after every attempt."
|
| 46 |
+
},
|
| 47 |
+
"budget": {
|
| 48 |
+
"max_retries": 3,
|
| 49 |
+
"max_runtime_minutes": 90
|
| 50 |
+
},
|
| 51 |
+
"escalation": {
|
| 52 |
+
"conditions": ["manual criterion is ambiguous", "screen-reader behavior requires specialist review", "shared design token must change", "user flow changes materially"],
|
| 53 |
+
"destination": "Accessibility reviewer and component owner"
|
| 54 |
+
},
|
| 55 |
+
"exit": {
|
| 56 |
+
"success": "The exact regression is repaired, adjacent checks pass, and required manual criteria are approved.",
|
| 57 |
+
"stop_without_success": "The issue cannot be reproduced, needs product judgment, conflicts with the design system, or exceeds the retry budget."
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
examples/adversarial-red-team-loop.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Adversarial red-team loop",
|
| 3 |
+
"objective": "Discover and confirm agent-system failures inside an authorized threat model with reproducible evidence and safe disclosure.",
|
| 4 |
+
"trigger": {
|
| 5 |
+
"type": "scheduled",
|
| 6 |
+
"cadence_or_event": "A bounded pre-release campaign runs after a model, tool, permission, or policy change."
|
| 7 |
+
},
|
| 8 |
+
"intake": {
|
| 9 |
+
"sources": ["target version", "written threat model", "allowed attack classes", "regression corpus", "known findings", "disclosure contacts"],
|
| 10 |
+
"selection_rule": "Probe one uncovered, in-scope attack class at a time using synthetic data and a sandboxed target."
|
| 11 |
+
},
|
| 12 |
+
"workspace": {
|
| 13 |
+
"isolation": "Sandboxed target with synthetic accounts, fake credentials, network boundaries, and rate limits.",
|
| 14 |
+
"allowed_actions": ["generate in-scope probes", "run against the sandbox", "reproduce and minimize traces", "write private finding reports"],
|
| 15 |
+
"disallowed_actions": ["test production", "use real user data", "exfiltrate data", "persist access", "publish unpatched findings"]
|
| 16 |
+
},
|
| 17 |
+
"context": {
|
| 18 |
+
"required_files": ["threat model", "safety policy", "tool permission map", "disclosure procedure"],
|
| 19 |
+
"runtime_sources": ["target configuration", "probe and seed", "full agent trace", "tool calls", "regression results"]
|
| 20 |
+
},
|
| 21 |
+
"agents": [
|
| 22 |
+
{
|
| 23 |
+
"role": "Attacker",
|
| 24 |
+
"responsibility": "Generate and adapt probes inside the written scope and budget."
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"role": "Reproducer",
|
| 28 |
+
"responsibility": "Confirm candidate failures independently in a clean sandbox."
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"role": "Minimizer",
|
| 32 |
+
"responsibility": "Reduce confirmed behavior to the smallest safe, reliable test case."
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"role": "Judge",
|
| 36 |
+
"responsibility": "Classify confirmed, duplicate, expected, or inconclusive behavior against the written policy."
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verification": {
|
| 40 |
+
"gates": ["behavior reproduces on the recorded target version", "finding cites a violated policy or boundary", "a separate judge confirms the result", "minimized test contains no real secrets or user data", "duplicate and severity review are complete"],
|
| 41 |
+
"receipts": ["target version and environment", "seed and probe", "full and minimized traces", "reproduction count", "policy citation", "severity and disclosure status"]
|
| 42 |
+
},
|
| 43 |
+
"state": {
|
| 44 |
+
"artifacts": ["private campaign ledger", "confirmed finding report", "regression corpus entry"],
|
| 45 |
+
"update_rule": "Record every candidate with target version, trace, reproduction status, classification, duplicate link, severity rationale, and disclosure owner."
|
| 46 |
+
},
|
| 47 |
+
"budget": {
|
| 48 |
+
"max_retries": 3,
|
| 49 |
+
"max_runtime_minutes": 120
|
| 50 |
+
},
|
| 51 |
+
"escalation": {
|
| 52 |
+
"conditions": ["critical behavior is confirmed", "production impact is possible", "scope is ambiguous", "containment is unsafe", "real data may be exposed"],
|
| 53 |
+
"destination": "Security owner through the private disclosure channel"
|
| 54 |
+
},
|
| 55 |
+
"exit": {
|
| 56 |
+
"success": "A campaign completes with every confirmed failure reproduced, minimized, privately reported, and added to the regression corpus.",
|
| 57 |
+
"stop_without_success": "Budget is exhausted, the target is unstable, scope becomes ambiguous, a rate limit is reached, or human intervention is required."
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
examples/benchmark-optimization-loop.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Benchmark optimization loop",
|
| 3 |
+
"objective": "Improve a measurable system outcome through reproducible experiments without weakening correctness or protected secondary metrics.",
|
| 4 |
+
"trigger": {
|
| 5 |
+
"type": "scheduled",
|
| 6 |
+
"cadence_or_event": "A bounded overnight experiment window starts against a frozen benchmark baseline."
|
| 7 |
+
},
|
| 8 |
+
"intake": {
|
| 9 |
+
"sources": ["baseline artifact and score", "frozen benchmark", "correctness suite", "experiment ledger", "compute budget"],
|
| 10 |
+
"selection_rule": "Run one falsifiable, non-duplicate candidate change at a time against the last accepted baseline."
|
| 11 |
+
},
|
| 12 |
+
"workspace": {
|
| 13 |
+
"isolation": "Disposable worktree or sandbox per candidate, rooted at the last accepted artifact.",
|
| 14 |
+
"allowed_actions": ["read prior experiment receipts", "edit the declared optimization surface", "run correctness checks", "run the frozen benchmark"],
|
| 15 |
+
"disallowed_actions": ["edit scorers", "inspect holdout answers", "weaken correctness gates", "change multiple variables in one candidate"]
|
| 16 |
+
},
|
| 17 |
+
"context": {
|
| 18 |
+
"required_files": ["benchmark specification", "correctness test configuration", "protected metric policy", "experiment ledger"],
|
| 19 |
+
"runtime_sources": ["environment fingerprint", "baseline score distribution", "candidate measurements", "compute usage"]
|
| 20 |
+
},
|
| 21 |
+
"agents": [
|
| 22 |
+
{
|
| 23 |
+
"role": "Experiment designer",
|
| 24 |
+
"responsibility": "Propose one falsifiable change and its expected effect without repeating a rejected hypothesis."
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"role": "Implementer",
|
| 28 |
+
"responsibility": "Apply only the declared candidate change in an isolated workspace."
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"role": "Verifier",
|
| 32 |
+
"responsibility": "Run unchanged correctness gates and repeated benchmark measurements."
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"role": "Recorder",
|
| 36 |
+
"responsibility": "Accept or reject the candidate and persist a reproducible experiment receipt."
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verification": {
|
| 40 |
+
"gates": ["correctness and safety checks pass unchanged", "benchmark version and environment match the baseline", "primary metric improves by the minimum delta across required repeats", "protected secondary metrics remain within tolerance"],
|
| 41 |
+
"receipts": ["hypothesis", "candidate diff", "commands and environment fingerprint", "raw score distribution", "cost", "accept or reject decision"]
|
| 42 |
+
},
|
| 43 |
+
"state": {
|
| 44 |
+
"artifacts": ["versioned accepted baseline", "experiment ledger", "candidate receipt"],
|
| 45 |
+
"update_rule": "Append every candidate with its hypothesis, diff, measurements, cost, and decision; only accepted candidates become the next baseline."
|
| 46 |
+
},
|
| 47 |
+
"budget": {
|
| 48 |
+
"max_retries": 5,
|
| 49 |
+
"max_runtime_minutes": 240
|
| 50 |
+
},
|
| 51 |
+
"escalation": {
|
| 52 |
+
"conditions": ["metric conflicts with observed quality", "benchmark instability exceeds tolerance", "candidate changes the evaluator", "additional permissions or compute are required"],
|
| 53 |
+
"destination": "Experiment owner or evaluation lead"
|
| 54 |
+
},
|
| 55 |
+
"exit": {
|
| 56 |
+
"success": "The target metric is reached reproducibly while correctness and protected metrics remain within policy.",
|
| 57 |
+
"stop_without_success": "Budget is exhausted, evidence is unstable, hypotheses repeat, or the next change requires owner judgment."
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
examples/knowledge-freshness-loop.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Knowledge freshness loop",
|
| 3 |
+
"objective": "Keep an agent retrieval corpus current, attributable, policy-compliant, and measurably useful before atomic promotion.",
|
| 4 |
+
"trigger": {
|
| 5 |
+
"type": "scheduled",
|
| 6 |
+
"cadence_or_event": "Daily refresh of changed or expired sources in the approved registry."
|
| 7 |
+
},
|
| 8 |
+
"intake": {
|
| 9 |
+
"sources": ["approved source registry", "last accepted manifest", "changed documents", "retrieval evaluation set", "access and retention policy"],
|
| 10 |
+
"selection_rule": "Fetch only approved sources whose checksum changed, freshness window expired, or deletion status changed."
|
| 11 |
+
},
|
| 12 |
+
"workspace": {
|
| 13 |
+
"isolation": "Versioned candidate corpus and index separate from production.",
|
| 14 |
+
"allowed_actions": ["fetch approved sources", "parse and deduplicate content", "build a candidate index", "run retrieval and leakage evaluations", "write a promotion receipt"],
|
| 15 |
+
"disallowed_actions": ["add unapproved domains", "change source access policy", "write directly to production", "retain revoked content"]
|
| 16 |
+
},
|
| 17 |
+
"context": {
|
| 18 |
+
"required_files": ["source registry", "freshness policy", "data classification policy", "retrieval evaluation set"],
|
| 19 |
+
"runtime_sources": ["source checksums", "fetch and parse logs", "candidate manifest", "retrieval and grounded-answer metrics"]
|
| 20 |
+
},
|
| 21 |
+
"agents": [
|
| 22 |
+
{
|
| 23 |
+
"role": "Source monitor",
|
| 24 |
+
"responsibility": "Detect additions, changes, removals, and expired freshness windows."
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"role": "Curator",
|
| 28 |
+
"responsibility": "Resolve authority, scope, duplicates, metadata, and quarantine decisions."
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"role": "Indexer",
|
| 32 |
+
"responsibility": "Build a versioned candidate corpus and retrieval index."
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"role": "Evaluator",
|
| 36 |
+
"responsibility": "Gate freshness, provenance, retrieval quality, grounded answers, and sensitive-data leakage."
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verification": {
|
| 40 |
+
"gates": ["every item maps to an approved canonical source", "required sources meet freshness windows and removals are tombstoned", "retrieval and grounded-answer quality meet baseline", "sensitive or revoked content is absent", "promotion is atomic and reversible"],
|
| 41 |
+
"receipts": ["source manifest diff", "checksums and fetch times", "parser and index versions", "evaluation results", "promotion or quarantine decision"]
|
| 42 |
+
},
|
| 43 |
+
"state": {
|
| 44 |
+
"artifacts": ["accepted source manifest", "versioned index", "tombstone ledger", "refresh receipt", "rollback pointer"],
|
| 45 |
+
"update_rule": "Persist provenance, access class, checksum, parser version, evaluation results, exceptions, and promotion status for every changed source."
|
| 46 |
+
},
|
| 47 |
+
"budget": {
|
| 48 |
+
"max_retries": 2,
|
| 49 |
+
"max_runtime_minutes": 120
|
| 50 |
+
},
|
| 51 |
+
"escalation": {
|
| 52 |
+
"conditions": ["authoritative sources conflict", "access policy changes", "sensitive data is detected", "parser corruption affects coverage", "freshness and retrieval quality trade off"],
|
| 53 |
+
"destination": "Knowledge owner, data steward, or security reviewer"
|
| 54 |
+
},
|
| 55 |
+
"exit": {
|
| 56 |
+
"success": "The versioned candidate passes provenance, freshness, policy, and retrieval gates and is promoted atomically.",
|
| 57 |
+
"stop_without_success": "No sources changed, a hard gate fails, the budget is exhausted, or owner judgment is required."
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
examples/performance-regression-loop.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Performance regression loop",
|
| 3 |
+
"objective": "Turn a reproducible performance regression into a profiled, narrow fix that restores the budget without weakening correctness.",
|
| 4 |
+
"trigger": {
|
| 5 |
+
"type": "event",
|
| 6 |
+
"cadence_or_event": "A benchmark or service-level metric regresses beyond the declared noise tolerance."
|
| 7 |
+
},
|
| 8 |
+
"intake": {
|
| 9 |
+
"sources": ["baseline and candidate commits", "pinned workload", "environment fingerprint", "profiles and telemetry", "correctness suite"],
|
| 10 |
+
"selection_rule": "Investigate only a regression reproducible under the pinned workload and controlled environment."
|
| 11 |
+
},
|
| 12 |
+
"workspace": {
|
| 13 |
+
"isolation": "Clean worktree on fixed benchmark hardware or a controlled runner.",
|
| 14 |
+
"allowed_actions": ["run profiles", "run repeated benchmarks", "edit the measured bottleneck", "add focused performance tests"],
|
| 15 |
+
"disallowed_actions": ["edit the benchmark workload", "reduce sample count", "disable correctness tests", "change production systems"]
|
| 16 |
+
},
|
| 17 |
+
"context": {
|
| 18 |
+
"required_files": ["benchmark specification", "correctness suite configuration", "performance budget", "environment lockfile"],
|
| 19 |
+
"runtime_sources": ["baseline measurement distribution", "candidate measurements", "profile", "service telemetry sample"]
|
| 20 |
+
},
|
| 21 |
+
"agents": [
|
| 22 |
+
{
|
| 23 |
+
"role": "Reproducer",
|
| 24 |
+
"responsibility": "Confirm the regression under the frozen workload and environment."
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"role": "Profiler",
|
| 28 |
+
"responsibility": "Localize time, allocation, I/O, or contention hotspots before edits."
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"role": "Implementer",
|
| 32 |
+
"responsibility": "Apply one evidence-backed change to the measured bottleneck."
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"role": "Verifier",
|
| 36 |
+
"responsibility": "Run correctness and compare repeated performance distributions and protected metrics."
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verification": {
|
| 40 |
+
"gates": ["correctness and safety checks pass unchanged", "baseline and candidate share workload and environment fingerprint", "change exceeds noise tolerance", "tail latency memory throughput and cost remain within protected budgets"],
|
| 41 |
+
"receipts": ["environment fingerprint", "raw baseline and candidate measurements", "profile", "commands", "candidate diff", "accept or reject decision"]
|
| 42 |
+
},
|
| 43 |
+
"state": {
|
| 44 |
+
"artifacts": ["performance investigation ledger", "profile artifact", "measurement bundle"],
|
| 45 |
+
"update_rule": "Record workload, environment, samples, profile, hypothesis, diff, protected metrics, and decision for every candidate."
|
| 46 |
+
},
|
| 47 |
+
"budget": {
|
| 48 |
+
"max_retries": 3,
|
| 49 |
+
"max_runtime_minutes": 180
|
| 50 |
+
},
|
| 51 |
+
"escalation": {
|
| 52 |
+
"conditions": ["regression is production-only", "benchmark environment is unstable", "fix trades correctness for speed", "architectural or capacity decision is required"],
|
| 53 |
+
"destination": "Performance owner or service architect"
|
| 54 |
+
},
|
| 55 |
+
"exit": {
|
| 56 |
+
"success": "The target performance budget is restored reproducibly with correctness and protected metrics intact.",
|
| 57 |
+
"stop_without_success": "The regression cannot be reproduced, measurements are too noisy, budget is exhausted, or an architectural decision is required."
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
examples/runnable/README.md
CHANGED
|
@@ -1,26 +1,29 @@
|
|
| 1 |
-
# Runnable
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
##
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
- [Claude Code desktop scheduled task](claude-desktop-scheduled-task.md) - local scheduled runs with file access and missed-run guardrails.
|
| 13 |
-
- [Codex automation](codex-automation.md) - unattended background task in an isolated worktree.
|
| 14 |
-
- [GitHub agentic workflow](github-agentic-workflow.md) - scheduled or event-triggered loop in GitHub Actions.
|
| 15 |
-
- [Shell / cron loop](shell-cron-loop.md) - minimal cron wrapper that delegates to an agent CLI and records receipts.
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
```sh
|
| 24 |
# Claude Code
|
| 25 |
CHECK_CMD="pytest -x" AGENT_CMD="claude -p" ./test-repair-loop.sh
|
| 26 |
|
|
@@ -28,32 +31,108 @@ CHECK_CMD="pytest -x" AGENT_CMD="claude -p" ./test-repair-loop.sh
|
|
| 28 |
CHECK_CMD="npm test" AGENT_CMD="codex exec" ./test-repair-loop.sh
|
| 29 |
```
|
| 30 |
|
| 31 |
-
Run it
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
| Contract part |
|
| 36 |
-
| ---
|
| 37 |
-
| Objective
|
| 38 |
-
|
|
| 39 |
-
|
|
| 40 |
-
|
|
| 41 |
-
|
|
| 42 |
-
|
|
| 43 |
-
| State | `LOOP_PROGRESS.md` receipts survive iterations and reruns |
|
| 44 |
-
| Budget | `MAX_ITERATIONS` (default 5) |
|
| 45 |
-
| Escalation | Non-zero exit with a recorded reason |
|
| 46 |
-
| Exit | Check passes, budget exhausted, or identical failure repeats |
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
- **
|
| 53 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
-
-
|
| 58 |
-
-
|
| 59 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Runnable Loop Starters
|
| 2 |
|
| 3 |
+
Eight implementation starters connect a loop contract to a runtime. Three are dependency-light executables; five are copy/paste runtime templates with concrete prompts, schedules, permissions, state, and stop conditions.
|
| 4 |
|
| 5 |
+
These are deliberately small. They demonstrate the control loop without hiding permissions, verification, state, or budgets inside a framework.
|
| 6 |
|
| 7 |
+
## Choose A Starter
|
| 8 |
|
| 9 |
+
| Starter | Form | Best when | Trigger | State | External gate |
|
| 10 |
+
| --- | --- | --- | --- | --- | --- |
|
| 11 |
+
| [`test-repair-loop.sh`](test-repair-loop.sh) | **Executable** Bash | A deterministic command is failing | Manual bootstrap | Markdown progress ledger | Check-command exit code |
|
| 12 |
+
| [`threshold-monitor-loop.sh`](threshold-monitor-loop.sh) | **Executable** Bash | A metric must stay above or below a boundary | Bounded polling cadence | Markdown sample receipts | Numeric threshold comparison |
|
| 13 |
+
| [`queue-worker-loop.py`](queue-worker-loop.py) | **Executable** Python | Independent JSONL work items need bounded processing | Manual or scheduler | JSONL item receipts | Per-item verifier exit code |
|
| 14 |
+
| [Claude Code `/loop`](claude-loop.md) | Copy/paste template | You are present in an open coding session | Session interval | Session + progress file | Project check command |
|
| 15 |
+
| [Claude desktop scheduled task](claude-desktop-scheduled-task.md) | Copy/paste template | Local files need a recurring desktop task | Local schedule | Last-run marker + output | Live source checks |
|
| 16 |
+
| [Codex automation](codex-automation.md) | Copy/paste template | Background work belongs in an isolated worktree | Schedule | Worktree receipts + report | Declared repository checks |
|
| 17 |
+
| [GitHub agentic workflow](github-agentic-workflow.md) | Copy/paste template | Work starts from GitHub events or Actions schedules | Event or cron | Issue, PR, artifact, or cache | Required workflow checks |
|
| 18 |
+
| [Shell / cron](shell-cron-loop.md) | Copy/paste template | An existing agent CLI needs minimal OS scheduling | Cron | Lock + progress file | Script exit code |
|
| 19 |
|
| 20 |
+
Use the [runtime selection guide](../../meta/RUNTIME_SELECTION.md) when persistence, file access, isolation, or permissions determine the choice. Vendor templates describe a portable operating shape, not a guarantee of current product behavior; confirm commands and scheduling semantics in the linked official docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
## Executable 1: Test Repair
|
| 23 |
|
| 24 |
+
This starter runs a deterministic check, sends only the failing evidence to an agent, and reruns the check until it passes, the evidence stops changing, or the budget expires.
|
| 25 |
|
| 26 |
+
```bash
|
|
|
|
|
|
|
| 27 |
# Claude Code
|
| 28 |
CHECK_CMD="pytest -x" AGENT_CMD="claude -p" ./test-repair-loop.sh
|
| 29 |
|
|
|
|
| 31 |
CHECK_CMD="npm test" AGENT_CMD="codex exec" ./test-repair-loop.sh
|
| 32 |
```
|
| 33 |
|
| 34 |
+
Run it inside a branch, worktree, or sandbox. The script edits nothing itself, but the delegated agent can.
|
| 35 |
+
|
| 36 |
+
| Contract part | Implementation |
|
| 37 |
+
| --- | --- |
|
| 38 |
+
| Objective | Make `CHECK_CMD` pass |
|
| 39 |
+
| Intake | Last `EVIDENCE_LINES` lines of failing output |
|
| 40 |
+
| Verification | `CHECK_CMD` exit code, judged by the script |
|
| 41 |
+
| State | `LOOP_PROGRESS.md` |
|
| 42 |
+
| Budget | `MAX_ITERATIONS`, default 5 |
|
| 43 |
+
| Escalation | Repeated evidence or exhausted budget returns non-zero |
|
| 44 |
+
|
| 45 |
+
## Executable 2: Threshold Monitor
|
| 46 |
+
|
| 47 |
+
This read-only starter samples a command that prints one number. It records each sample and exits on the first boundary breach. An optional agent can diagnose the evidence, but the script never remediates.
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
PROBE_CMD="./scripts/p95_latency_ms.sh" \
|
| 51 |
+
THRESHOLD=250 \
|
| 52 |
+
DIRECTION=max \
|
| 53 |
+
MAX_SAMPLES=12 \
|
| 54 |
+
INTERVAL_SECONDS=300 \
|
| 55 |
+
AGENT_CMD="codex exec" \
|
| 56 |
+
./threshold-monitor-loop.sh
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Set `DIRECTION=max` when values above the threshold are bad, such as latency or spend. Set `DIRECTION=min` when values below it are bad, such as pass rate or availability.
|
| 60 |
+
|
| 61 |
+
| Contract part | Implementation |
|
| 62 |
+
| --- | --- |
|
| 63 |
+
| Objective | Keep a measured signal inside its declared boundary |
|
| 64 |
+
| Intake | Numeric final line from `PROBE_CMD` |
|
| 65 |
+
| Verification | `awk` compares the value with `THRESHOLD` |
|
| 66 |
+
| State | `MONITOR_PROGRESS.md` |
|
| 67 |
+
| Budget | `MAX_SAMPLES` and `INTERVAL_SECONDS` |
|
| 68 |
+
| Escalation | Probe error or first threshold breach |
|
| 69 |
+
|
| 70 |
+
## Executable 3: Queue Worker
|
| 71 |
+
|
| 72 |
+
This starter reads JSONL work items, skips IDs already marked complete, delegates one item at a time, runs an external verifier, and persists every attempt.
|
| 73 |
+
|
| 74 |
+
Minimum queue row:
|
| 75 |
+
|
| 76 |
+
```json
|
| 77 |
+
{"id":"docs-101","objective":"Update the CLI install example","allowed_paths":["README.md"],"verification":"python3 scripts/check_docs.py"}
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
Validate before invoking an agent:
|
| 81 |
|
| 82 |
+
```bash
|
| 83 |
+
python3 queue-worker-loop.py --queue tasks.jsonl --dry-run
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
Process a bounded batch:
|
| 87 |
+
|
| 88 |
+
```bash
|
| 89 |
+
python3 queue-worker-loop.py \
|
| 90 |
+
--queue tasks.jsonl \
|
| 91 |
+
--agent-command "codex exec" \
|
| 92 |
+
--verify-command "python3 verify_item.py {id}" \
|
| 93 |
+
--max-items 3 \
|
| 94 |
+
--max-retries 2 \
|
| 95 |
+
--command-timeout 900
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
The verifier receives the current item ID through both `{id}` substitution and the `LOOP_ITEM_ID` environment variable.
|
| 99 |
|
| 100 |
+
| Contract part | Implementation |
|
| 101 |
+
| --- | --- |
|
| 102 |
+
| Objective | Each queue row's `objective` |
|
| 103 |
+
| Intake | Pending JSONL rows after completed IDs are removed |
|
| 104 |
+
| Verification | `--verify-command` exit code |
|
| 105 |
+
| State | `QUEUE_PROGRESS.jsonl` |
|
| 106 |
+
| Budget | `--max-items`, `--max-retries`, and `--command-timeout` |
|
| 107 |
+
| Escalation | A work item exhausts its retry budget |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
+
A timed-out agent or verifier consumes one attempt and leaves a receipt before the item retries or escalates.
|
| 110 |
|
| 111 |
+
## Design Choices Worth Copying
|
| 112 |
+
|
| 113 |
+
- **The maker does not check its own work.** External commands or thresholds decide completion.
|
| 114 |
+
- **State lives outside the model.** Markdown or JSONL receipts survive cold agent calls and reruns.
|
| 115 |
+
- **Completed work is idempotent.** Queue IDs and last-run markers prevent duplicate processing.
|
| 116 |
+
- **Evidence stops waste.** Repeated failures and threshold breaches stop or escalate instead of consuming an open-ended budget.
|
| 117 |
+
- **Permissions remain visible.** The starters expect a branch, worktree, sandbox, or read-only boundary rather than pretending isolation is automatic.
|
| 118 |
+
|
| 119 |
+
## Smoke Checks
|
| 120 |
+
|
| 121 |
+
Run these without an agent account:
|
| 122 |
+
|
| 123 |
+
```bash
|
| 124 |
+
bash -n test-repair-loop.sh threshold-monitor-loop.sh
|
| 125 |
+
python3 -m py_compile queue-worker-loop.py
|
| 126 |
+
printf '%s\n' '{"id":"demo","objective":"Validate the queue"}' > /tmp/loop-queue.jsonl
|
| 127 |
+
python3 queue-worker-loop.py --queue /tmp/loop-queue.jsonl --dry-run
|
| 128 |
+
PROBE_CMD="printf '42\\n'" THRESHOLD=100 MAX_SAMPLES=1 ./threshold-monitor-loop.sh
|
| 129 |
+
```
|
| 130 |
|
| 131 |
+
## Adapting A Starter
|
| 132 |
|
| 133 |
+
- Replace the verifier first; it defines what "done" means.
|
| 134 |
+
- Map allowed paths, tools, credentials, and network access from the chosen JSON contract.
|
| 135 |
+
- Keep mutable work away from the benchmark, policy, or tests that judge it.
|
| 136 |
+
- Choose a durable state artifact that the next cold run can read.
|
| 137 |
+
- Start with one item or iteration, then raise budgets only after reviewing receipts.
|
| 138 |
+
- Test failure, timeout, duplicate work, and human escalation before scheduling unattended runs.
|
examples/runnable/queue-worker-loop.py
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Bounded, receipt-producing queue loop for an agent CLI.
|
| 3 |
+
|
| 4 |
+
Queue rows are JSON objects with an ``id`` and ``objective``. The loop skips
|
| 5 |
+
completed IDs, passes one item at a time to an agent command, runs an external
|
| 6 |
+
verification command, and persists every attempt as JSONL state.
|
| 7 |
+
|
| 8 |
+
The script edits nothing itself. Run it in a branch, worktree, or sandbox that
|
| 9 |
+
matches the permissions described in each queue item.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
import argparse
|
| 15 |
+
import datetime as dt
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
import shlex
|
| 19 |
+
import subprocess
|
| 20 |
+
import sys
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
from typing import Any
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def load_jsonl(path: Path) -> list[dict[str, Any]]:
|
| 26 |
+
rows: list[dict[str, Any]] = []
|
| 27 |
+
seen_ids: set[str] = set()
|
| 28 |
+
for number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), start=1):
|
| 29 |
+
if not line.strip():
|
| 30 |
+
continue
|
| 31 |
+
try:
|
| 32 |
+
row = json.loads(line)
|
| 33 |
+
except json.JSONDecodeError as error:
|
| 34 |
+
raise ValueError(f"{path}:{number}: invalid JSON: {error}") from error
|
| 35 |
+
if not isinstance(row, dict) or not isinstance(row.get("id"), str) or not row["id"].strip():
|
| 36 |
+
raise ValueError(f"{path}:{number}: each row needs a non-empty string 'id'")
|
| 37 |
+
if not isinstance(row.get("objective"), str) or not row["objective"].strip():
|
| 38 |
+
raise ValueError(f"{path}:{number}: each row needs a non-empty string 'objective'")
|
| 39 |
+
if row["id"] in seen_ids:
|
| 40 |
+
raise ValueError(f"{path}:{number}: duplicate item id {row['id']!r}")
|
| 41 |
+
seen_ids.add(row["id"])
|
| 42 |
+
rows.append(row)
|
| 43 |
+
return rows
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def completed_ids(state_path: Path) -> set[str]:
|
| 47 |
+
if not state_path.exists():
|
| 48 |
+
return set()
|
| 49 |
+
completed: set[str] = set()
|
| 50 |
+
for number, line in enumerate(state_path.read_text(encoding="utf-8").splitlines(), start=1):
|
| 51 |
+
if not line.strip():
|
| 52 |
+
continue
|
| 53 |
+
try:
|
| 54 |
+
row = json.loads(line)
|
| 55 |
+
except json.JSONDecodeError as error:
|
| 56 |
+
raise ValueError(f"{state_path}:{number}: invalid JSON: {error}") from error
|
| 57 |
+
if not isinstance(row, dict) or not isinstance(row.get("id"), str):
|
| 58 |
+
raise ValueError(f"{state_path}:{number}: each receipt needs a string 'id'")
|
| 59 |
+
if row.get("status") == "completed":
|
| 60 |
+
completed.add(row["id"])
|
| 61 |
+
return completed
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def append_receipt(state_path: Path, receipt: dict[str, Any]) -> None:
|
| 65 |
+
state_path.parent.mkdir(parents=True, exist_ok=True)
|
| 66 |
+
with state_path.open("a", encoding="utf-8") as handle:
|
| 67 |
+
handle.write(json.dumps(receipt, ensure_ascii=True, sort_keys=True) + "\n")
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def utc_now() -> str:
|
| 71 |
+
return dt.datetime.now(dt.timezone.utc).isoformat(timespec="seconds")
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def command_argv(command: str, *, item_id: str) -> list[str]:
|
| 75 |
+
return [argument.replace("{id}", item_id) for argument in shlex.split(command)]
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def main() -> int:
|
| 79 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 80 |
+
parser.add_argument("--queue", type=Path, required=True, help="JSONL work queue")
|
| 81 |
+
parser.add_argument("--state", type=Path, default=Path("QUEUE_PROGRESS.jsonl"), help="durable JSONL receipt log")
|
| 82 |
+
parser.add_argument("--agent-command", help="agent CLI; the item prompt is appended as one argument")
|
| 83 |
+
parser.add_argument("--verify-command", help="deterministic command; {id} expands to the current item ID")
|
| 84 |
+
parser.add_argument("--max-items", type=int, default=5, help="maximum unprocessed items per run")
|
| 85 |
+
parser.add_argument("--max-retries", type=int, default=2, help="agent attempts per item")
|
| 86 |
+
parser.add_argument("--command-timeout", type=int, default=900, help="seconds allowed for each agent or verifier command")
|
| 87 |
+
parser.add_argument("--dry-run", action="store_true", help="validate and display pending work without invoking commands")
|
| 88 |
+
args = parser.parse_args()
|
| 89 |
+
|
| 90 |
+
if args.max_items < 1 or args.max_retries < 1 or args.command_timeout < 1:
|
| 91 |
+
parser.error("--max-items, --max-retries, and --command-timeout must be positive")
|
| 92 |
+
if not args.dry_run and (not args.agent_command or not args.verify_command):
|
| 93 |
+
parser.error("--agent-command and --verify-command are required unless --dry-run is used")
|
| 94 |
+
|
| 95 |
+
try:
|
| 96 |
+
queue = load_jsonl(args.queue)
|
| 97 |
+
done = completed_ids(args.state)
|
| 98 |
+
except (OSError, ValueError) as error:
|
| 99 |
+
print(error, file=sys.stderr)
|
| 100 |
+
return 3
|
| 101 |
+
|
| 102 |
+
pending = [item for item in queue if item["id"] not in done][: args.max_items]
|
| 103 |
+
if args.dry_run:
|
| 104 |
+
print(json.dumps({"queue_items": len(queue), "completed": len(done), "pending_this_run": pending}, indent=2))
|
| 105 |
+
return 0
|
| 106 |
+
|
| 107 |
+
if not pending:
|
| 108 |
+
print("[queue] no pending work")
|
| 109 |
+
return 0
|
| 110 |
+
|
| 111 |
+
agent_argv = command_argv(args.agent_command, item_id="")
|
| 112 |
+
for item in pending:
|
| 113 |
+
item_id = item["id"]
|
| 114 |
+
print(f"[queue] processing {item_id}", file=sys.stderr)
|
| 115 |
+
|
| 116 |
+
for attempt in range(1, args.max_retries + 1):
|
| 117 |
+
prompt = "\n".join(
|
| 118 |
+
[
|
| 119 |
+
"You are one bounded worker inside a durable work-queue loop.",
|
| 120 |
+
"",
|
| 121 |
+
"Work item:",
|
| 122 |
+
json.dumps(item, indent=2, ensure_ascii=True),
|
| 123 |
+
"",
|
| 124 |
+
f"Attempt: {attempt} of {args.max_retries}",
|
| 125 |
+
f"Command timeout: {args.command_timeout} seconds",
|
| 126 |
+
f"State log: {args.state}",
|
| 127 |
+
"",
|
| 128 |
+
"Rules:",
|
| 129 |
+
"- Read repository instructions and prior receipts before acting.",
|
| 130 |
+
"- Stay inside the permissions and scope named by the item.",
|
| 131 |
+
"- Make the smallest change that satisfies the objective.",
|
| 132 |
+
"- Do not decide that the item is complete; an external command verifies it.",
|
| 133 |
+
"- Leave enough evidence for a human to review the attempt.",
|
| 134 |
+
]
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
try:
|
| 138 |
+
agent_result = subprocess.run([*agent_argv, prompt], check=False, timeout=args.command_timeout)
|
| 139 |
+
verify_argv = command_argv(args.verify_command, item_id=item_id)
|
| 140 |
+
verify_env = {**os.environ, "LOOP_ITEM_ID": item_id}
|
| 141 |
+
verify_result = subprocess.run(verify_argv, check=False, env=verify_env, timeout=args.command_timeout)
|
| 142 |
+
except subprocess.TimeoutExpired:
|
| 143 |
+
append_receipt(
|
| 144 |
+
args.state,
|
| 145 |
+
{
|
| 146 |
+
"id": item_id,
|
| 147 |
+
"attempt": attempt,
|
| 148 |
+
"status": "retry",
|
| 149 |
+
"reason": f"agent or verifier exceeded {args.command_timeout}s timeout",
|
| 150 |
+
"timestamp": utc_now(),
|
| 151 |
+
},
|
| 152 |
+
)
|
| 153 |
+
print(
|
| 154 |
+
f"[queue] {item_id}: command exceeded {args.command_timeout}s timeout",
|
| 155 |
+
file=sys.stderr,
|
| 156 |
+
)
|
| 157 |
+
continue
|
| 158 |
+
except OSError as error:
|
| 159 |
+
append_receipt(
|
| 160 |
+
args.state,
|
| 161 |
+
{
|
| 162 |
+
"id": item_id,
|
| 163 |
+
"attempt": attempt,
|
| 164 |
+
"status": "escalated",
|
| 165 |
+
"reason": f"command could not start: {error}",
|
| 166 |
+
"timestamp": utc_now(),
|
| 167 |
+
},
|
| 168 |
+
)
|
| 169 |
+
print(f"[queue] {item_id}: command could not start: {error}", file=sys.stderr)
|
| 170 |
+
return 3
|
| 171 |
+
status = "completed" if agent_result.returncode == 0 and verify_result.returncode == 0 else "retry"
|
| 172 |
+
|
| 173 |
+
append_receipt(
|
| 174 |
+
args.state,
|
| 175 |
+
{
|
| 176 |
+
"id": item_id,
|
| 177 |
+
"attempt": attempt,
|
| 178 |
+
"status": status,
|
| 179 |
+
"agent_exit": agent_result.returncode,
|
| 180 |
+
"verify_exit": verify_result.returncode,
|
| 181 |
+
"timestamp": utc_now(),
|
| 182 |
+
},
|
| 183 |
+
)
|
| 184 |
+
|
| 185 |
+
if status == "completed":
|
| 186 |
+
print(f"[queue] {item_id}: verified", file=sys.stderr)
|
| 187 |
+
break
|
| 188 |
+
else:
|
| 189 |
+
append_receipt(
|
| 190 |
+
args.state,
|
| 191 |
+
{
|
| 192 |
+
"id": item_id,
|
| 193 |
+
"attempt": args.max_retries,
|
| 194 |
+
"status": "escalated",
|
| 195 |
+
"reason": "retry budget exhausted",
|
| 196 |
+
"timestamp": utc_now(),
|
| 197 |
+
},
|
| 198 |
+
)
|
| 199 |
+
print(f"[queue] {item_id}: retry budget exhausted; escalating", file=sys.stderr)
|
| 200 |
+
return 2
|
| 201 |
+
|
| 202 |
+
return 0
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
if __name__ == "__main__":
|
| 206 |
+
raise SystemExit(main())
|
examples/runnable/threshold-monitor-loop.sh
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Read-only threshold monitor for deploy, performance, cost, and data-quality loops.
|
| 3 |
+
#
|
| 4 |
+
# PROBE_CMD must print one numeric value on its final output line. The script
|
| 5 |
+
# samples it on a bounded cadence, records receipts, and optionally asks an
|
| 6 |
+
# agent for diagnosis when the threshold is breached. It never remediates.
|
| 7 |
+
#
|
| 8 |
+
# Examples:
|
| 9 |
+
# PROBE_CMD="./scripts/p95_latency_ms.sh" THRESHOLD=250 DIRECTION=max ./threshold-monitor-loop.sh
|
| 10 |
+
# PROBE_CMD="./scripts/pass_rate.sh" THRESHOLD=0.95 DIRECTION=min AGENT_CMD="codex exec" ./threshold-monitor-loop.sh
|
| 11 |
+
#
|
| 12 |
+
# Exit codes: 0 all samples healthy, 2 threshold breached, 3 usage/probe error.
|
| 13 |
+
|
| 14 |
+
set -u
|
| 15 |
+
|
| 16 |
+
PROBE_CMD="${PROBE_CMD:-${1:-}}"
|
| 17 |
+
THRESHOLD="${THRESHOLD:-${2:-}}"
|
| 18 |
+
DIRECTION="${DIRECTION:-${3:-max}}"
|
| 19 |
+
AGENT_CMD="${AGENT_CMD:-}"
|
| 20 |
+
MAX_SAMPLES="${MAX_SAMPLES:-5}"
|
| 21 |
+
INTERVAL_SECONDS="${INTERVAL_SECONDS:-60}"
|
| 22 |
+
PROGRESS_FILE="${PROGRESS_FILE:-MONITOR_PROGRESS.md}"
|
| 23 |
+
|
| 24 |
+
usage() {
|
| 25 |
+
echo "Usage: PROBE_CMD='./probe.sh' THRESHOLD=250 DIRECTION=max $0" >&2
|
| 26 |
+
echo "DIRECTION=max breaches above the threshold; min breaches below it." >&2
|
| 27 |
+
exit 3
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
is_number() {
|
| 31 |
+
printf '%s\n' "$1" | awk 'BEGIN { ok = 0 } /^[[:space:]]*-?([0-9]+([.][0-9]*)?|[.][0-9]+)[[:space:]]*$/ { ok = 1 } END { exit ok ? 0 : 1 }'
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
if [ -z "$PROBE_CMD" ] || [ -z "$THRESHOLD" ]; then
|
| 35 |
+
usage
|
| 36 |
+
fi
|
| 37 |
+
|
| 38 |
+
if [ "$DIRECTION" != "max" ] && [ "$DIRECTION" != "min" ]; then
|
| 39 |
+
usage
|
| 40 |
+
fi
|
| 41 |
+
|
| 42 |
+
if ! is_number "$THRESHOLD"; then
|
| 43 |
+
echo "[monitor] THRESHOLD must be numeric: $THRESHOLD" >&2
|
| 44 |
+
exit 3
|
| 45 |
+
fi
|
| 46 |
+
|
| 47 |
+
if ! printf '%s\n' "$MAX_SAMPLES" | awk '/^[1-9][0-9]*$/ { ok = 1 } END { exit ok ? 0 : 1 }'; then
|
| 48 |
+
echo "[monitor] MAX_SAMPLES must be a positive integer." >&2
|
| 49 |
+
exit 3
|
| 50 |
+
fi
|
| 51 |
+
|
| 52 |
+
record() {
|
| 53 |
+
printf '%s\n' "$1" >> "$PROGRESS_FILE"
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
if [ ! -f "$PROGRESS_FILE" ]; then
|
| 57 |
+
record "# Threshold monitor receipts"
|
| 58 |
+
fi
|
| 59 |
+
|
| 60 |
+
record ""
|
| 61 |
+
record "## Run started $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
| 62 |
+
record ""
|
| 63 |
+
record "- Probe: \`$PROBE_CMD\`"
|
| 64 |
+
record "- Boundary: $DIRECTION threshold $THRESHOLD"
|
| 65 |
+
record "- Budget: $MAX_SAMPLES samples, ${INTERVAL_SECONDS}s interval"
|
| 66 |
+
|
| 67 |
+
sample=0
|
| 68 |
+
while [ "$sample" -lt "$MAX_SAMPLES" ]; do
|
| 69 |
+
sample=$((sample + 1))
|
| 70 |
+
echo "[monitor] sample $sample/$MAX_SAMPLES" >&2
|
| 71 |
+
|
| 72 |
+
probe_output="$(bash -c "$PROBE_CMD" 2>&1)"
|
| 73 |
+
probe_status=$?
|
| 74 |
+
value="$(printf '%s\n' "$probe_output" | tail -n 1 | tr -d '[:space:]')"
|
| 75 |
+
|
| 76 |
+
if [ "$probe_status" -ne 0 ] || ! is_number "$value"; then
|
| 77 |
+
echo "[monitor] probe failed or did not end with a numeric value." >&2
|
| 78 |
+
record "- Sample $sample: probe error (exit $probe_status); escalated."
|
| 79 |
+
record ""
|
| 80 |
+
record " \`\`\`text"
|
| 81 |
+
printf '%s\n' "$probe_output" | tail -n 20 | sed 's/^/ /' >> "$PROGRESS_FILE"
|
| 82 |
+
record " \`\`\`"
|
| 83 |
+
exit 3
|
| 84 |
+
fi
|
| 85 |
+
|
| 86 |
+
breached="$(awk -v value="$value" -v threshold="$THRESHOLD" -v direction="$DIRECTION" 'BEGIN { if (direction == "max") print (value > threshold ? "yes" : "no"); else print (value < threshold ? "yes" : "no") }')"
|
| 87 |
+
record "- Sample $sample: value $value; status $([ "$breached" = "yes" ] && printf 'breached' || printf 'healthy')."
|
| 88 |
+
|
| 89 |
+
if [ "$breached" = "yes" ]; then
|
| 90 |
+
echo "[monitor] threshold breached: value=$value, $DIRECTION threshold=$THRESHOLD" >&2
|
| 91 |
+
|
| 92 |
+
if [ -n "$AGENT_CMD" ]; then
|
| 93 |
+
read -r -a agent_argv <<< "$AGENT_CMD"
|
| 94 |
+
prompt="You are the read-only diagnosis role in a threshold-monitor loop.
|
| 95 |
+
|
| 96 |
+
Probe command: $PROBE_CMD
|
| 97 |
+
Observed value: $value
|
| 98 |
+
Boundary: $DIRECTION threshold $THRESHOLD
|
| 99 |
+
Sample: $sample of $MAX_SAMPLES
|
| 100 |
+
|
| 101 |
+
Recent probe output:
|
| 102 |
+
---
|
| 103 |
+
$(printf '%s\n' "$probe_output" | tail -n 40)
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
Diagnose likely causes and name the next evidence a human should inspect.
|
| 107 |
+
Do not modify files, services, configuration, deployments, or alert state.
|
| 108 |
+
Append a concise diagnosis to $PROGRESS_FILE if your runtime permits it."
|
| 109 |
+
"${agent_argv[@]}" "$prompt"
|
| 110 |
+
agent_status=$?
|
| 111 |
+
record "- Diagnosis agent exited with status $agent_status."
|
| 112 |
+
fi
|
| 113 |
+
|
| 114 |
+
record "- Threshold breach escalated; no remediation attempted."
|
| 115 |
+
exit 2
|
| 116 |
+
fi
|
| 117 |
+
|
| 118 |
+
if [ "$sample" -lt "$MAX_SAMPLES" ]; then
|
| 119 |
+
sleep "$INTERVAL_SECONDS"
|
| 120 |
+
fi
|
| 121 |
+
done
|
| 122 |
+
|
| 123 |
+
echo "[monitor] all $MAX_SAMPLES samples remained within the boundary." >&2
|
| 124 |
+
record "- All samples healthy. Loop complete."
|
| 125 |
+
exit 0
|
| 126 |
+
|
meta/DISTRIBUTION.md
CHANGED
|
@@ -4,12 +4,12 @@ Use this checklist after major updates or releases. Optimize for qualified disco
|
|
| 4 |
|
| 5 |
## Current Launch Status
|
| 6 |
|
| 7 |
-
Status as of 2026-07-
|
| 8 |
|
| 9 |
| Surface | Status | Evidence / next action |
|
| 10 |
| --- | --- | --- |
|
| 11 |
-
| GitHub release | Complete | [`v0.
|
| 12 |
-
| Release announcement | Ready | Publish the v0.
|
| 13 |
| GitHub Explore topic | Complete | [`github/explore#5209`](https://github.com/github/explore/pull/5209) merged the `loop-engineering` topic page. |
|
| 14 |
| Canonical Awesome directory | Policy objection | [`sindresorhus/awesome#4339`](https://github.com/sindresorhus/awesome/pull/4339) is open and lint passes, but the owner stated that AI-generated lists are not accepted. Do not treat further visual polish as a path around that policy or misrepresent automated assistance. |
|
| 15 |
| Adjacent harness directory | In review | [`ai-boost/awesome-harness-engineering#131`](https://github.com/ai-boost/awesome-harness-engineering/pull/131) transparently proposes the project for the list's Related Awesome Lists section. |
|
|
@@ -33,7 +33,7 @@ The Hugging Face dataset [`datasets/cy0307/awesome-loop-engineering`](https://hu
|
|
| 33 |
|
| 34 |
- The mirror tracks the full GitHub tree (docs, patterns, examples, schema, scripts).
|
| 35 |
- The dataset mirror includes generated resource sheets at `data/resources.csv` and `data/resources.jsonl`, refreshed from the canonical English `README.md` by `scripts/export_resource_dataset.py`.
|
| 36 |
-
- The HF copy of `README.md` is a focused dataset card generated from `meta/hf_card_header.yaml` and `meta/hf_card_body.md` by `scripts/build_hf_card.py`. It documents intended uses, provenance, limitations, loading examples, and the current audit snapshot without duplicating the
|
| 37 |
- The YAML header is **HF-only**: it must never be added to the GitHub `README.md`, because the metadata list items break `awesome-lint`.
|
| 38 |
- Sync uses `python3 scripts/build_hf_card.py --output <staging>/README.md` followed by `hf upload --type dataset` against a staging copy. The token lives in the local Hugging Face cache; no token is committed.
|
| 39 |
|
|
@@ -46,11 +46,11 @@ Use GitHub-native discovery in this order.
|
|
| 46 |
- **Editorial submissions to adjacent lists** this repo already cites (harness, context, and agent-paper lists). Submit only where the maintainers explicitly accept related resources. Ready-to-paste entry:
|
| 47 |
|
| 48 |
```md
|
| 49 |
-
- [Awesome Loop Engineering](https://github.com/ChaoYue0307/awesome-loop-engineering#readme) - Source-audited resources, reusable patterns, validated contracts, and
|
| 50 |
```
|
| 51 |
|
| 52 |
- **Pin the repository** on your profile, and add it to your profile README (profile-level promotion).
|
| 53 |
-
- **About description.** Keep this concise proof-point copy aligned with the README and project site: `🔁
|
| 54 |
- **Custom social preview** (repo Settings, Social preview) so shared links lead with the same four durable proof points. This is UI-only; it cannot be set through the API.
|
| 55 |
- **Releases and Discussions** provide a lower-noise subscription path. Recommend `Watch -> Custom -> Releases and Discussions`; do not ask readers to watch every repository event.
|
| 56 |
|
|
@@ -91,7 +91,7 @@ Use the canonical [English launch article](../posts/launch.md) or [Chinese launc
|
|
| 91 |
### Short Post
|
| 92 |
|
| 93 |
```text
|
| 94 |
-
🔁 Awesome Loop Engineering v0.
|
| 95 |
|
| 96 |
🧭 Explore:
|
| 97 |
https://chaoyue0307.github.io/awesome-loop-engineering/
|
|
@@ -102,16 +102,16 @@ https://chaoyue0307.github.io/awesome-loop-engineering/
|
|
| 102 |
### Longer Post
|
| 103 |
|
| 104 |
```text
|
| 105 |
-
Awesome Loop Engineering v0.
|
| 106 |
|
| 107 |
Loop Engineering governs what happens across agent runs: how work enters, agents act, evidence decides, state survives, and the system continues.
|
| 108 |
|
| 109 |
The release includes:
|
| 110 |
|
| 111 |
-
-
|
| 112 |
- an interactive Resource Atlas
|
| 113 |
-
-
|
| 114 |
-
-
|
| 115 |
- CSV and JSONL exports mirrored to Hugging Face
|
| 116 |
- a public provenance standard and point-in-time source audit
|
| 117 |
|
|
@@ -124,11 +124,11 @@ https://github.com/ChaoYue0307/awesome-loop-engineering
|
|
| 124 |
Use a regular submission, not Show HN.
|
| 125 |
|
| 126 |
```text
|
| 127 |
-
Title: Awesome Loop Engineering:
|
| 128 |
|
| 129 |
I have been mapping recurring AI-agent systems: how work enters, agents act, evidence gates results, state survives, and the system retries, escalates, or exits.
|
| 130 |
|
| 131 |
-
The repository includes
|
| 132 |
|
| 133 |
https://github.com/ChaoYue0307/awesome-loop-engineering
|
| 134 |
```
|
|
@@ -160,7 +160,7 @@ Use [`OUTREACH.md`](OUTREACH.md) for wording.
|
|
| 160 |
- Direct Loop Engineering article authors.
|
| 161 |
- Agent runtime maintainers with scheduling, goals, hooks, worktrees, skills, plugins, or subagents.
|
| 162 |
- Benchmark maintainers for long-horizon coding agents.
|
| 163 |
-
- Builders who can contribute real PR babysitting, CI repair, docs drift, deploy verification, or feedback clustering loops.
|
| 164 |
|
| 165 |
## Awesome List Submission
|
| 166 |
|
|
|
|
| 4 |
|
| 5 |
## Current Launch Status
|
| 6 |
|
| 7 |
+
Status as of 2026-07-18:
|
| 8 |
|
| 9 |
| Surface | Status | Evidence / next action |
|
| 10 |
| --- | --- | --- |
|
| 11 |
+
| GitHub release | Complete | [`v0.7.0`](https://github.com/ChaoYue0307/awesome-loop-engineering/releases/tag/v0.7.0) packages 545 resources, 20 patterns and contracts, and 8 runtime starters. |
|
| 12 |
+
| Release announcement | Ready | Publish the v0.7.0 summary from [`posts/launch.md`](../posts/launch.md); [Discussion #9](https://github.com/ChaoYue0307/awesome-loop-engineering/discussions/9) remains the low-noise release and contributor feed. |
|
| 13 |
| GitHub Explore topic | Complete | [`github/explore#5209`](https://github.com/github/explore/pull/5209) merged the `loop-engineering` topic page. |
|
| 14 |
| Canonical Awesome directory | Policy objection | [`sindresorhus/awesome#4339`](https://github.com/sindresorhus/awesome/pull/4339) is open and lint passes, but the owner stated that AI-generated lists are not accepted. Do not treat further visual polish as a path around that policy or misrepresent automated assistance. |
|
| 15 |
| Adjacent harness directory | In review | [`ai-boost/awesome-harness-engineering#131`](https://github.com/ai-boost/awesome-harness-engineering/pull/131) transparently proposes the project for the list's Related Awesome Lists section. |
|
|
|
|
| 33 |
|
| 34 |
- The mirror tracks the full GitHub tree (docs, patterns, examples, schema, scripts).
|
| 35 |
- The dataset mirror includes generated resource sheets at `data/resources.csv` and `data/resources.jsonl`, refreshed from the canonical English `README.md` by `scripts/export_resource_dataset.py`.
|
| 36 |
+
- The HF copy of `README.md` is a focused dataset card generated from `meta/hf_card_header.yaml` and `meta/hf_card_body.md` by `scripts/build_hf_card.py`. It documents intended uses, provenance, limitations, loading examples, and the current audit snapshot without duplicating the 545-row GitHub README.
|
| 37 |
- The YAML header is **HF-only**: it must never be added to the GitHub `README.md`, because the metadata list items break `awesome-lint`.
|
| 38 |
- Sync uses `python3 scripts/build_hf_card.py --output <staging>/README.md` followed by `hf upload --type dataset` against a staging copy. The token lives in the local Hugging Face cache; no token is committed.
|
| 39 |
|
|
|
|
| 46 |
- **Editorial submissions to adjacent lists** this repo already cites (harness, context, and agent-paper lists). Submit only where the maintainers explicitly accept related resources. Ready-to-paste entry:
|
| 47 |
|
| 48 |
```md
|
| 49 |
+
- [Awesome Loop Engineering](https://github.com/ChaoYue0307/awesome-loop-engineering#readme) - Source-audited resources, reusable patterns, validated contracts, and runtime starters for recurring AI-agent systems.
|
| 50 |
```
|
| 51 |
|
| 52 |
- **Pin the repository** on your profile, and add it to your profile README (profile-level promotion).
|
| 53 |
+
- **About description.** Keep this concise proof-point copy aligned with the README and project site: `🔁 545 source-audited resources • 20 patterns • 20 validated contracts • 8 runtime starters • interactive atlas + dataset for recurring, stateful, verified AI-agent systems.`
|
| 54 |
- **Custom social preview** (repo Settings, Social preview) so shared links lead with the same four durable proof points. This is UI-only; it cannot be set through the API.
|
| 55 |
- **Releases and Discussions** provide a lower-noise subscription path. Recommend `Watch -> Custom -> Releases and Discussions`; do not ask readers to watch every repository event.
|
| 56 |
|
|
|
|
| 91 |
### Short Post
|
| 92 |
|
| 93 |
```text
|
| 94 |
+
🔁 Awesome Loop Engineering v0.7.0 is live: 545 source-audited resources, 20 operational patterns, 20 validated contracts, and 8 runtime starters for recurring AI-agent systems.
|
| 95 |
|
| 96 |
🧭 Explore:
|
| 97 |
https://chaoyue0307.github.io/awesome-loop-engineering/
|
|
|
|
| 102 |
### Longer Post
|
| 103 |
|
| 104 |
```text
|
| 105 |
+
Awesome Loop Engineering v0.7.0 is live.
|
| 106 |
|
| 107 |
Loop Engineering governs what happens across agent runs: how work enters, agents act, evidence decides, state survives, and the system continues.
|
| 108 |
|
| 109 |
The release includes:
|
| 110 |
|
| 111 |
+
- 545 source-audited resources
|
| 112 |
- an interactive Resource Atlas
|
| 113 |
+
- 20 operational patterns and 20 validated loop contracts
|
| 114 |
+
- 8 runtime starters: 3 executables and 5 copy/paste templates
|
| 115 |
- CSV and JSONL exports mirrored to Hugging Face
|
| 116 |
- a public provenance standard and point-in-time source audit
|
| 117 |
|
|
|
|
| 124 |
Use a regular submission, not Show HN.
|
| 125 |
|
| 126 |
```text
|
| 127 |
+
Title: Awesome Loop Engineering: 545 resources and 20 loop patterns for recurring AI-agent systems
|
| 128 |
|
| 129 |
I have been mapping recurring AI-agent systems: how work enters, agents act, evidence gates results, state survives, and the system retries, escalates, or exits.
|
| 130 |
|
| 131 |
+
The repository includes 545 source-audited works, 20 operational patterns, 20 validated contracts, 8 runtime starters, an interactive Resource Atlas, and a structured Hugging Face dataset. The curation and audit methods are public; corrections to the taxonomy and annotations are especially welcome.
|
| 132 |
|
| 133 |
https://github.com/ChaoYue0307/awesome-loop-engineering
|
| 134 |
```
|
|
|
|
| 160 |
- Direct Loop Engineering article authors.
|
| 161 |
- Agent runtime maintainers with scheduling, goals, hooks, worktrees, skills, plugins, or subagents.
|
| 162 |
- Benchmark maintainers for long-horizon coding agents.
|
| 163 |
+
- Builders who can contribute real PR babysitting, CI repair, docs drift, deploy verification, benchmark optimization, knowledge freshness, or feedback clustering loops.
|
| 164 |
|
| 165 |
## Awesome List Submission
|
| 166 |
|
meta/OUTREACH.md
CHANGED
|
@@ -38,7 +38,7 @@ https://github.com/ChaoYue0307/awesome-loop-engineering/issues/new?template=anno
|
|
| 38 |
## Maintainer Request
|
| 39 |
|
| 40 |
```text
|
| 41 |
-
Hi <name>, Awesome Loop Engineering is a source-audited field guide and implementation kit for recurring AI-agent systems. It includes
|
| 42 |
|
| 43 |
Would it fit the related-resources policy for <project or newsletter>? I can provide a shorter description or submit through the normal contribution process:
|
| 44 |
https://github.com/ChaoYue0307/awesome-loop-engineering
|
|
|
|
| 38 |
## Maintainer Request
|
| 39 |
|
| 40 |
```text
|
| 41 |
+
Hi <name>, Awesome Loop Engineering is a source-audited field guide and implementation kit for recurring AI-agent systems. It includes 545 resources, 20 operational patterns, 20 validated contracts, 8 runtime starters, and a structured dataset.
|
| 42 |
|
| 43 |
Would it fit the related-resources policy for <project or newsletter>? I can provide a shorter description or submit through the normal contribution process:
|
| 44 |
https://github.com/ChaoYue0307/awesome-loop-engineering
|
meta/hf_card_body.md
CHANGED
|
@@ -26,9 +26,9 @@ Current release: **v{{VERSION}}**
|
|
| 26 |
| Source-audited resources | {{RESOURCE_COUNT}} |
|
| 27 |
| Operational patterns | {{PATTERN_COUNT}} |
|
| 28 |
| Validated loop contracts | {{CONTRACT_COUNT}} |
|
| 29 |
-
|
|
| 30 |
|
| 31 |
-
The source audit dated **{{AUDIT_DATE}}**
|
| 32 |
|
| 33 |
## Load The Data
|
| 34 |
|
|
@@ -65,7 +65,7 @@ Use `url` as the durable join key. `row_id` and `source_line` are positional and
|
|
| 65 |
- Compare works by lifecycle, audience, evidence class, source type, and publication metadata.
|
| 66 |
- Build literature maps, reading lists, dashboards, or retrieval indexes.
|
| 67 |
- Audit contribution, novelty, impact, provenance, and evidence claims.
|
| 68 |
-
- Find reusable patterns, contracts, schemas, and
|
| 69 |
|
| 70 |
Do not use `signal_strength`, GitHub stars, forks, or inclusion in this collection as a quality label, endorsement, or automated ranking of scientific validity.
|
| 71 |
|
|
|
|
| 26 |
| Source-audited resources | {{RESOURCE_COUNT}} |
|
| 27 |
| Operational patterns | {{PATTERN_COUNT}} |
|
| 28 |
| Validated loop contracts | {{CONTRACT_COUNT}} |
|
| 29 |
+
| Runtime starters | {{RUNNABLE_COUNT}} |
|
| 30 |
|
| 31 |
+
The source audit dated **{{AUDIT_DATE}}** reports these row statuses: **{{REACHABLE_COUNT}} reachable public**, **{{RESTRICTED_COUNT}} access restricted**, **{{LOCAL_COUNT}} repository-native**, and **{{BROKEN_COUNT}} broken or unreachable**.
|
| 32 |
|
| 33 |
## Load The Data
|
| 34 |
|
|
|
|
| 65 |
- Compare works by lifecycle, audience, evidence class, source type, and publication metadata.
|
| 66 |
- Build literature maps, reading lists, dashboards, or retrieval indexes.
|
| 67 |
- Audit contribution, novelty, impact, provenance, and evidence claims.
|
| 68 |
+
- Find reusable patterns, contracts, schemas, executable examples, and copy/paste runtime templates.
|
| 69 |
|
| 70 |
Do not use `signal_strength`, GitHub stars, forks, or inclusion in this collection as a quality label, endorsement, or automated ranking of scientific validity.
|
| 71 |
|
meta/social-preview.html
CHANGED
|
@@ -79,10 +79,10 @@
|
|
| 79 |
<p>Recur / verify / persist</p>
|
| 80 |
</div>
|
| 81 |
<div class="stats">
|
| 82 |
-
<div class="stat"><b>
|
| 83 |
-
<div class="stat"><b>
|
| 84 |
-
<div class="stat"><b>
|
| 85 |
-
<div class="stat"><b>
|
| 86 |
</div>
|
| 87 |
</main>
|
| 88 |
</body>
|
|
|
|
| 79 |
<p>Recur / verify / persist</p>
|
| 80 |
</div>
|
| 81 |
<div class="stats">
|
| 82 |
+
<div class="stat"><b>545</b><span>Source-audited resources</span></div>
|
| 83 |
+
<div class="stat"><b>20</b><span>Operational patterns</span></div>
|
| 84 |
+
<div class="stat"><b>20</b><span>Validated contracts</span></div>
|
| 85 |
+
<div class="stat"><b>8</b><span>Runtime starters</span></div>
|
| 86 |
</div>
|
| 87 |
</main>
|
| 88 |
</body>
|
patterns/MATRIX.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# Pattern Matrix
|
| 2 |
|
| 3 |
-
A side-by-side comparison of
|
| 4 |
|
| 5 |
## How To Read This Matrix
|
| 6 |
|
|
@@ -26,12 +26,17 @@ Every pattern links to its full write-up and a schema-valid contract in [`exampl
|
|
| 26 |
| [Feedback clusterer](feedback-clusterer.md) | Feedback is noisy and unsorted | Schedule: daily or weekly | Issues, tickets, threads, reviews | Processed IDs, cluster definitions | Clusters cite sources, frequency vs severity | 1 retry / 90 min | Security, legal, or prioritization conflicts | Claude Code routines, Codex automations |
|
| 27 |
| [Dependency triage loop](dependency-triage-loop.md) | Dependency updates pile up | Schedule: weekly + bot PRs | Update PRs, advisories, lockfile diff | Processed updates, deferral reasons | Tests, typecheck, build, audit pass | 2 retries / 60 min | Major versions, advisories, migrations | gh-aw, Codex automations, shell/cron |
|
| 28 |
| [Evaluation regression loop](evaluation-regression-loop.md) | Agent evals regressed | Schedule: nightly + score drop | Eval runs, traces, recent commits | Run IDs, hypotheses, rerun scores | Targeted tasks return to baseline | 3 retries / 120 min | Scorer bugs or overfitting risk | Custom durable runtime, shell/cron |
|
|
|
|
| 29 |
| [Security review loop](security-review-loop.md) | Sensitive changes need review | Event: sensitive diff; weekly pass | Diffs, threat model, scan output | Reviewed SHA, findings, false positives | Findings cite concrete evidence | 2 retries / 90 min | Credentials, crypto, exploitability doubt | Claude Code routines, gh-aw |
|
|
|
|
|
|
|
| 30 |
| [Cost-control loop](cost-control-loop.md) | Agent spend is rising | Schedule + spend threshold | Usage telemetry, traces, billing | Baseline spend, proposed changes | Quality gates hold on a comparable sample | 2 retries / 60 min | Quality tradeoffs or routing changes | Custom durable runtime, shell/cron |
|
|
|
|
| 31 |
| [Bug hunting loop](bug-hunting-loop.md) | Recurring bug discovery | Schedule: weekly on active modules | Logs, flaky tests, traces, diffs | Checked areas, reproductions | Reproducible steps or failing test | 3 retries / 90 min | Production-only or security-sensitive bugs | Claude Code routines, shell/cron |
|
| 32 |
| [Enterprise approval loop](enterprise-approval-loop.md) | A change needs sign-off | Schedule + gate/approver events | Change request, gates, approvers | Approval ledger, gate status | Every gate has a recorded human decision | 3 retries / SLA window | Failed gate or unresponsive approver | Custom durable runtime, gh-aw |
|
| 33 |
| [Incident response loop](incident-response-loop.md) | An incident just paged | Event: alert; refresh 2-5 min | Alert, dashboards, traces, changes | Incident timeline, hypotheses | Severity backed by impact evidence | 2 retries / incident life | Outage, data loss, or mitigation needed | Custom durable runtime, shell/cron |
|
| 34 |
| [Data-quality loop](data-quality-loop.md) | A dataset keeps drifting | Event: refresh; or nightly | New version, schema, prior baseline | Profile metrics, accepted exceptions | Hard rules pass before promotion | 2 retries / 90 min | Schema change or regulated fields | Custom durable runtime, shell/cron |
|
|
|
|
| 35 |
| [Release-note loop](release-note-loop.md) | Release notes are a chore | Event: release branch or tag | Merged PRs, issues, commits | Processed IDs, draft changelog | Every entry links to a source | 2 retries / 60 min | Security advisories or wording calls | gh-aw, Codex automations |
|
| 36 |
| [Model-routing loop](model-routing-loop.md) | Model choice is ad hoc | Schedule + model/price change | Per-task telemetry, eval results | Task-class metrics, routing log | Replays hold quality within tolerance | 2 retries / 120 min | Privacy tier or quality-cost tradeoffs | Custom durable runtime |
|
| 37 |
|
|
|
|
| 1 |
# Pattern Matrix
|
| 2 |
|
| 3 |
+
A side-by-side comparison of all 20 loops in the [pattern library](README.md). Use it to pick a pattern, compare trade-offs, or check that your own loop names the same parts.
|
| 4 |
|
| 5 |
## How To Read This Matrix
|
| 6 |
|
|
|
|
| 26 |
| [Feedback clusterer](feedback-clusterer.md) | Feedback is noisy and unsorted | Schedule: daily or weekly | Issues, tickets, threads, reviews | Processed IDs, cluster definitions | Clusters cite sources, frequency vs severity | 1 retry / 90 min | Security, legal, or prioritization conflicts | Claude Code routines, Codex automations |
|
| 27 |
| [Dependency triage loop](dependency-triage-loop.md) | Dependency updates pile up | Schedule: weekly + bot PRs | Update PRs, advisories, lockfile diff | Processed updates, deferral reasons | Tests, typecheck, build, audit pass | 2 retries / 60 min | Major versions, advisories, migrations | gh-aw, Codex automations, shell/cron |
|
| 28 |
| [Evaluation regression loop](evaluation-regression-loop.md) | Agent evals regressed | Schedule: nightly + score drop | Eval runs, traces, recent commits | Run IDs, hypotheses, rerun scores | Targeted tasks return to baseline | 3 retries / 120 min | Scorer bugs or overfitting risk | Custom durable runtime, shell/cron |
|
| 29 |
+
| [Benchmark optimization loop](benchmark-optimization-loop.md) | A stable system should improve on a metric | Bounded schedule + new baseline | Frozen benchmark, correctness suite, ledger | Accepted baseline, candidate receipts | Repeated improvement with protected metrics intact | 5 candidates / 240 min | Metric conflict, evaluator drift, more compute | Custom durable runtime, isolated worktrees |
|
| 30 |
| [Security review loop](security-review-loop.md) | Sensitive changes need review | Event: sensitive diff; weekly pass | Diffs, threat model, scan output | Reviewed SHA, findings, false positives | Findings cite concrete evidence | 2 retries / 90 min | Credentials, crypto, exploitability doubt | Claude Code routines, gh-aw |
|
| 31 |
+
| [Adversarial red-team loop](adversarial-red-team-loop.md) | An agent needs active adversarial testing | Pre-release campaign + capability change | Threat model, sandbox target, known findings | Campaign ledger, minimized traces | Independent reproduction and policy citation | 3 confirmations / 120 min | Critical finding, real impact, scope ambiguity | Sandboxed custom runtime |
|
| 32 |
+
| [Accessibility regression loop](accessibility-regression-loop.md) | A UI introduced an accessibility failure | Event: accessibility check fails | Rule, route, viewport, interaction, diff | Before/after evidence, manual review | Original rule plus required human criteria pass | 3 retries / 90 min | Ambiguous semantics or design-system change | CI, Codex automations, local browser runtime |
|
| 33 |
| [Cost-control loop](cost-control-loop.md) | Agent spend is rising | Schedule + spend threshold | Usage telemetry, traces, billing | Baseline spend, proposed changes | Quality gates hold on a comparable sample | 2 retries / 60 min | Quality tradeoffs or routing changes | Custom durable runtime, shell/cron |
|
| 34 |
+
| [Performance regression loop](performance-regression-loop.md) | Latency, throughput, or memory regressed | Event: metric exceeds tolerance | Baseline/candidate, workload, profile | Environment, samples, profile, decision | Correctness plus repeated performance budget | 3 candidates / 180 min | Production-only or architectural bottleneck | Controlled benchmark runner, shell/cron |
|
| 35 |
| [Bug hunting loop](bug-hunting-loop.md) | Recurring bug discovery | Schedule: weekly on active modules | Logs, flaky tests, traces, diffs | Checked areas, reproductions | Reproducible steps or failing test | 3 retries / 90 min | Production-only or security-sensitive bugs | Claude Code routines, shell/cron |
|
| 36 |
| [Enterprise approval loop](enterprise-approval-loop.md) | A change needs sign-off | Schedule + gate/approver events | Change request, gates, approvers | Approval ledger, gate status | Every gate has a recorded human decision | 3 retries / SLA window | Failed gate or unresponsive approver | Custom durable runtime, gh-aw |
|
| 37 |
| [Incident response loop](incident-response-loop.md) | An incident just paged | Event: alert; refresh 2-5 min | Alert, dashboards, traces, changes | Incident timeline, hypotheses | Severity backed by impact evidence | 2 retries / incident life | Outage, data loss, or mitigation needed | Custom durable runtime, shell/cron |
|
| 38 |
| [Data-quality loop](data-quality-loop.md) | A dataset keeps drifting | Event: refresh; or nightly | New version, schema, prior baseline | Profile metrics, accepted exceptions | Hard rules pass before promotion | 2 retries / 90 min | Schema change or regulated fields | Custom durable runtime, shell/cron |
|
| 39 |
+
| [Knowledge freshness loop](knowledge-freshness-loop.md) | An agent knowledge index is stale | Daily refresh + source change | Approved sources, manifest, retrieval evals | Versioned index, provenance, tombstones | Freshness, retrieval, leakage, atomic promotion | 2 retries / 120 min | Source conflict, access change, sensitive data | Custom durable runtime, scheduled task |
|
| 40 |
| [Release-note loop](release-note-loop.md) | Release notes are a chore | Event: release branch or tag | Merged PRs, issues, commits | Processed IDs, draft changelog | Every entry links to a source | 2 retries / 60 min | Security advisories or wording calls | gh-aw, Codex automations |
|
| 41 |
| [Model-routing loop](model-routing-loop.md) | Model choice is ad hoc | Schedule + model/price change | Per-task telemetry, eval results | Task-class metrics, routing log | Replays hold quality within tolerance | 2 retries / 120 min | Privacy tier or quality-cost tradeoffs | Custom durable runtime |
|
| 42 |
|
patterns/README.md
CHANGED
|
@@ -1,43 +1,86 @@
|
|
| 1 |
# Loop Pattern Library
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
Use
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
##
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Pattern Quality Bar
|
| 40 |
|
| 41 |
-
A
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
Reject patterns
|
|
|
|
| 1 |
# Loop Pattern Library
|
| 2 |
|
| 3 |
+
Twenty operational patterns turn the Loop Contract into repeatable ways of working. Every pattern names the problem, trigger, intake, permissions, roles, deterministic gate, durable state, budget, escalation path, and a matching schema-valid contract.
|
| 4 |
+
|
| 5 |
+
## Use The Library In Three Steps
|
| 6 |
+
|
| 7 |
+
1. Start from the symptom in the coverage map below.
|
| 8 |
+
1. Open the pattern to understand the operating model and worked example.
|
| 9 |
+
1. Adapt its linked JSON contract, then choose a [runtime starter](../examples/runnable/README.md).
|
| 10 |
+
|
| 11 |
+
The layers have different jobs:
|
| 12 |
+
|
| 13 |
+
| Layer | Question it answers | Artifact |
|
| 14 |
+
| --- | --- | --- |
|
| 15 |
+
| **Pattern** | How should this class of recurring work operate? | Human-readable playbook in this directory |
|
| 16 |
+
| **Contract** | What exactly may this loop read, change, verify, spend, and escalate? | Schema-valid JSON in [`examples/`](../examples/README.md) |
|
| 17 |
+
| **Runtime starter** | Where and how does the contract execute? | Copy/paste and executable starters in [`examples/runnable/`](../examples/runnable/README.md) |
|
| 18 |
+
|
| 19 |
+
## Coverage Map
|
| 20 |
+
|
| 21 |
+
### Build And Maintain
|
| 22 |
+
|
| 23 |
+
| Symptom | Pattern | Verified outcome |
|
| 24 |
+
| --- | --- | --- |
|
| 25 |
+
| A pull request is stalled | [PR babysitter](pr-babysitter.md) | Required checks pass, review threads are resolved, and merge state is current |
|
| 26 |
+
| CI keeps failing | [CI repair loop](ci-repair-loop.md) | The original failing command passes with a scoped patch |
|
| 27 |
+
| Documentation may be stale | [Docs drift collector](docs-drift-collector.md) | Verified code/docs mismatches are patched and examples still run |
|
| 28 |
+
| Dependency updates pile up | [Dependency triage loop](dependency-triage-loop.md) | Safe updates pass tests and risky upgrades have an owner-backed escalation |
|
| 29 |
+
| Bugs need systematic discovery | [Bug hunting loop](bug-hunting-loop.md) | Each accepted finding has reproducible steps or a failing test |
|
| 30 |
+
| Release notes are incomplete | [Release-note loop](release-note-loop.md) | Every shipped change maps to a merged source and audience-facing note |
|
| 31 |
+
|
| 32 |
+
### Operate And Observe
|
| 33 |
+
|
| 34 |
+
| Symptom | Pattern | Verified outcome |
|
| 35 |
+
| --- | --- | --- |
|
| 36 |
+
| A rollout needs watching | [Deploy verifier](deploy-verifier.md) | Synthetic checks and rollout thresholds remain within policy |
|
| 37 |
+
| An incident just paged | [Incident response loop](incident-response-loop.md) | Impact, evidence, timeline, and accountable owner are recorded |
|
| 38 |
+
| A dataset keeps drifting | [Data-quality loop](data-quality-loop.md) | Hard quality rules pass before a new version is promoted |
|
| 39 |
+
| Agent spend is rising | [Cost-control loop](cost-control-loop.md) | Spend falls on a comparable workload without quality regression |
|
| 40 |
+
| Model choice is ad hoc | [Model-routing loop](model-routing-loop.md) | Routing decisions meet quality, latency, privacy, and cost tolerances |
|
| 41 |
+
| Latency, throughput, or memory regressed | [Performance regression loop](performance-regression-loop.md) | A controlled benchmark confirms recovery with correctness intact |
|
| 42 |
+
|
| 43 |
+
### Learn And Optimize
|
| 44 |
+
|
| 45 |
+
| Symptom | Pattern | Verified outcome |
|
| 46 |
+
| --- | --- | --- |
|
| 47 |
+
| Feedback is noisy and unsorted | [Feedback clusterer](feedback-clusterer.md) | Themes cite source items and separate frequency from severity |
|
| 48 |
+
| Agent evaluations regressed | [Evaluation regression loop](evaluation-regression-loop.md) | Targeted evals return to the accepted baseline without scorer changes |
|
| 49 |
+
| A system should improve against a metric | [Benchmark optimization loop](benchmark-optimization-loop.md) | Repeated measurements confirm an improvement with protected metrics intact |
|
| 50 |
+
| An agent's knowledge is stale | [Knowledge freshness loop](knowledge-freshness-loop.md) | A versioned corpus passes provenance, freshness, retrieval, and leakage gates |
|
| 51 |
+
|
| 52 |
+
### Govern And Protect
|
| 53 |
+
|
| 54 |
+
| Symptom | Pattern | Verified outcome |
|
| 55 |
+
| --- | --- | --- |
|
| 56 |
+
| A sensitive change needs review | [Security review loop](security-review-loop.md) | Findings cite concrete evidence and approval boundaries stay intact |
|
| 57 |
+
| A change needs formal sign-off | [Enterprise approval loop](enterprise-approval-loop.md) | Every required gate has a recorded decision and audit trail |
|
| 58 |
+
| A UI introduced an accessibility failure | [Accessibility regression loop](accessibility-regression-loop.md) | The exact regression is fixed and required human criteria are approved |
|
| 59 |
+
| An agent system needs adversarial testing | [Adversarial red-team loop](adversarial-red-team-loop.md) | Confirmed findings are reproduced, minimized, privately reported, and regression-tested |
|
| 60 |
+
|
| 61 |
+
## Choosing Between Similar Patterns
|
| 62 |
+
|
| 63 |
+
| If the work sounds like... | Choose | Not |
|
| 64 |
+
| --- | --- | --- |
|
| 65 |
+
| "A known code change may be unsafe" | Security review | Adversarial red team, which actively discovers behavior failures |
|
| 66 |
+
| "Find new failures in a sandboxed agent" | Adversarial red team | Bug hunting, which is broader and not threat-model driven |
|
| 67 |
+
| "Our eval score dropped" | Evaluation regression | Benchmark optimization, which seeks new improvement from a stable baseline |
|
| 68 |
+
| "Make this system measurably better" | Benchmark optimization | Performance regression, unless the target is specifically latency, throughput, memory, or cost |
|
| 69 |
+
| "Our repo docs no longer match code" | Docs drift | Knowledge freshness, which maintains a multi-source retrieval corpus |
|
| 70 |
+
| "The retrieval corpus is stale" | Knowledge freshness | Data quality, unless the artifact is a general dataset rather than an agent knowledge index |
|
| 71 |
+
| "A scanner found an accessibility issue" | Accessibility regression | General CI repair, because automated checks do not cover all human accessibility criteria |
|
| 72 |
+
|
| 73 |
+
Compare trigger, state, gate, budget, escalation, and runtime across every pattern in the [full matrix](MATRIX.md).
|
| 74 |
|
| 75 |
## Pattern Quality Bar
|
| 76 |
|
| 77 |
+
A pattern qualifies for this library only when it:
|
| 78 |
+
|
| 79 |
+
- solves a recurring job that is materially distinct from an existing pattern;
|
| 80 |
+
- has an external feedback signal stronger than the acting model's opinion;
|
| 81 |
+
- names durable state, a hard budget, and a human handoff;
|
| 82 |
+
- states what the loop must not do;
|
| 83 |
+
- includes a worked scenario and a schema-valid contract;
|
| 84 |
+
- can map to at least one practical runtime without assuming unlimited permissions.
|
| 85 |
|
| 86 |
+
Reject patterns whose only gate is "the agent says it looks good." Prefer exit codes, score distributions, changed files, source manifests, trace IDs, dashboard thresholds, screenshots, or named reviewer decisions.
|
patterns/accessibility-regression-loop.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Accessibility Regression Loop
|
| 2 |
+
|
| 3 |
+
## Objective
|
| 4 |
+
|
| 5 |
+
Turn newly introduced accessibility failures into small, verified fixes while preserving a human review path for criteria that automation cannot judge.
|
| 6 |
+
|
| 7 |
+
## Use This When
|
| 8 |
+
|
| 9 |
+
- A web or app surface changes frequently.
|
| 10 |
+
- Automated accessibility checks and keyboard or screen-reader smoke tests already exist.
|
| 11 |
+
- The team wants evidence attached to each fix instead of a periodic audit backlog.
|
| 12 |
+
|
| 13 |
+
Do not treat an automated pass as proof of full WCAG conformance. The loop handles detectable regressions; people still judge usability, semantics, and assistive-technology behavior.
|
| 14 |
+
|
| 15 |
+
## Trigger
|
| 16 |
+
|
| 17 |
+
- Event: an accessibility check fails on a pull request or deployment preview.
|
| 18 |
+
- Schedule: nightly scan of high-value user journeys.
|
| 19 |
+
- Manual bootstrap: "repair the accessibility regression in <route or component>."
|
| 20 |
+
|
| 21 |
+
## Intake
|
| 22 |
+
|
| 23 |
+
- Failing rule, selector, route, viewport, browser, and test artifact.
|
| 24 |
+
- The changed diff, component ownership, design-system guidance, and prior baseline.
|
| 25 |
+
- Manual-test checklist for keyboard order, focus behavior, names, roles, states, contrast, motion, and zoom.
|
| 26 |
+
|
| 27 |
+
## Agents
|
| 28 |
+
|
| 29 |
+
- Reproducer: confirms the failure on the reported route and viewport.
|
| 30 |
+
- Fixer: changes the smallest component or token responsible.
|
| 31 |
+
- Verifier: reruns automated checks and the focused interaction test.
|
| 32 |
+
- Accessibility reviewer: handles ambiguous semantics and manual criteria.
|
| 33 |
+
|
| 34 |
+
## Workspace And Permissions
|
| 35 |
+
|
| 36 |
+
- Use a branch or worktree based on the failing commit.
|
| 37 |
+
- Allow component, style, test, and documentation edits within the affected surface.
|
| 38 |
+
- Disallow suppressing rules, hiding content from assistive technology, lowering thresholds, or rewriting shared tokens without owner review.
|
| 39 |
+
|
| 40 |
+
## Durable State
|
| 41 |
+
|
| 42 |
+
- Rule ID, route, viewport, affected users, before/after result, screenshots or trace, commands, and manual-review status.
|
| 43 |
+
|
| 44 |
+
## Loop Steps
|
| 45 |
+
|
| 46 |
+
1. Reproduce the exact failing rule and interaction.
|
| 47 |
+
1. Classify whether the failure is automatable, manual, or mixed.
|
| 48 |
+
1. Inspect the changed component and its design-system primitive.
|
| 49 |
+
1. Apply the smallest semantic, focus, label, contrast, motion, or target-size fix.
|
| 50 |
+
1. Rerun the focused check, adjacent component tests, and relevant user journey.
|
| 51 |
+
1. Route manual criteria to an accessibility reviewer with a concise evidence packet.
|
| 52 |
+
1. Persist the receipt and stop when both automated and required human gates pass.
|
| 53 |
+
|
| 54 |
+
## Verification Gates
|
| 55 |
+
|
| 56 |
+
- The original rule passes at the same route, viewport, and browser.
|
| 57 |
+
- Keyboard order, visible focus, accessible name, role, and state remain coherent for the affected interaction.
|
| 58 |
+
- No rule is disabled or threshold weakened to obtain the pass.
|
| 59 |
+
- Required manual checks are signed off by a named reviewer.
|
| 60 |
+
|
| 61 |
+
## Budget And Exit
|
| 62 |
+
|
| 63 |
+
- Max retries: 3 fix attempts.
|
| 64 |
+
- Max runtime: 90 minutes before handoff.
|
| 65 |
+
- Stop on verified repair, inability to reproduce, design-system conflict, or a failure that requires product judgment.
|
| 66 |
+
|
| 67 |
+
## Escalation
|
| 68 |
+
|
| 69 |
+
Escalate for ambiguous content alternatives, complex screen-reader behavior, cross-product token changes, legal conformance claims, or any fix that materially changes the user flow.
|
| 70 |
+
|
| 71 |
+
## Loop Instruction
|
| 72 |
+
|
| 73 |
+
```text
|
| 74 |
+
Repair the accessibility regression reported for <route/component>.
|
| 75 |
+
Reproduce the exact rule, browser, viewport, and interaction before editing.
|
| 76 |
+
Make the smallest standards-aligned fix and rerun the focused automated check plus
|
| 77 |
+
the keyboard/focus smoke test. Never disable a rule or hide content to obtain a pass.
|
| 78 |
+
Record before/after evidence and escalate manual WCAG judgments to <reviewer>.
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Worked Example
|
| 82 |
+
|
| 83 |
+
A navigation redesign removes visible focus from mobile menu links. The loop reproduces the failed focus test at 390 px, traces the regression to a shared outline token, patches the menu component without changing the global token, reruns the keyboard path and automated scan, and records a short video for human review.
|
| 84 |
+
|
| 85 |
+
## Failure Modes
|
| 86 |
+
|
| 87 |
+
- Equating zero automated violations with accessibility.
|
| 88 |
+
- Fixing one viewport while breaking another.
|
| 89 |
+
- Adding `aria-*` attributes that conflict with native semantics.
|
| 90 |
+
- Hiding problematic content from the accessibility tree.
|
| 91 |
+
- Skipping the manual check because the scanner is green.
|
| 92 |
+
|
| 93 |
+
## Example Contract
|
| 94 |
+
|
| 95 |
+
- [`examples/accessibility-regression-loop.json`](../examples/accessibility-regression-loop.json)
|
| 96 |
+
|
| 97 |
+
## References
|
| 98 |
+
|
| 99 |
+
- [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/) - Normative, testable accessibility criteria with both automated and human evaluation.
|
| 100 |
+
- [Understanding Test Rules for WCAG 2.2](https://www.w3.org/WAI/WCAG22/Understanding/understanding-act-rules.html) - Explains the role and limits of automated accessibility rules.
|
patterns/adversarial-red-team-loop.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adversarial Red-Team Loop
|
| 2 |
+
|
| 3 |
+
## Objective
|
| 4 |
+
|
| 5 |
+
Continuously discover, reproduce, minimize, and report agent-system failures under a bounded threat model without turning speculative attacks into unsupported findings.
|
| 6 |
+
|
| 7 |
+
## Use This When
|
| 8 |
+
|
| 9 |
+
- A deployed or pre-release agent has explicit tools, permissions, and safety boundaries.
|
| 10 |
+
- Tests can run in a sandbox or synthetic target with no real users or secrets.
|
| 11 |
+
- Findings require reproducible evidence and a human-owned disclosure path.
|
| 12 |
+
|
| 13 |
+
Use the security review loop for reviewing a known code change. Use this pattern when the work is active adversarial discovery against the behavior of an agent system.
|
| 14 |
+
|
| 15 |
+
## Trigger
|
| 16 |
+
|
| 17 |
+
- Schedule: bounded weekly or pre-release campaign.
|
| 18 |
+
- Event: new tool, model, permission, policy, or attack class.
|
| 19 |
+
- Manual bootstrap: "probe <target> against <threat model> for <budget>."
|
| 20 |
+
|
| 21 |
+
## Intake
|
| 22 |
+
|
| 23 |
+
- Target version, threat model, allowed attack classes, synthetic accounts, and prohibited actions.
|
| 24 |
+
- Policy, tool permissions, known findings, regression corpus, and disclosure contacts.
|
| 25 |
+
- Token, request, time, concurrency, and data budgets.
|
| 26 |
+
|
| 27 |
+
## Agents
|
| 28 |
+
|
| 29 |
+
- Attacker: generates and adapts probes within the allowed threat model.
|
| 30 |
+
- Reproducer: confirms candidate failures in a clean environment.
|
| 31 |
+
- Minimizer: reduces the trace to the smallest reliable test case.
|
| 32 |
+
- Judge: separates confirmed findings from policy-compliant or non-reproducible behavior.
|
| 33 |
+
|
| 34 |
+
## Workspace And Permissions
|
| 35 |
+
|
| 36 |
+
- Use a sandboxed target with synthetic data, fake credentials, and rate limits.
|
| 37 |
+
- Keep attack generation separate from confirmation and severity judgment.
|
| 38 |
+
- Disallow production exploitation, persistence, destructive actions, real-user data, external exfiltration, and testing outside written scope.
|
| 39 |
+
|
| 40 |
+
## Durable State
|
| 41 |
+
|
| 42 |
+
- Target version, seed, probe, full trace, tool calls, expected policy, reproduction count, severity rationale, duplicate link, and disclosure status.
|
| 43 |
+
|
| 44 |
+
## Loop Steps
|
| 45 |
+
|
| 46 |
+
1. Freeze target version, threat model, scope, and stop conditions.
|
| 47 |
+
1. Select an uncovered attack class or failed regression case.
|
| 48 |
+
1. Generate a bounded probe and run it against the sandboxed target.
|
| 49 |
+
1. Reproduce promising behavior independently and minimize the trace.
|
| 50 |
+
1. Judge against the written policy and classify confirmed, duplicate, expected, or inconclusive.
|
| 51 |
+
1. Add confirmed cases to the regression corpus and prepare a private evidence packet.
|
| 52 |
+
1. Stop on budget, risk threshold, scope ambiguity, or human intervention.
|
| 53 |
+
|
| 54 |
+
## Verification Gates
|
| 55 |
+
|
| 56 |
+
- The behavior reproduces on the recorded target version and environment.
|
| 57 |
+
- The finding cites the exact policy or security boundary it violates.
|
| 58 |
+
- A separate judge confirms the result; the attacking agent does not grade itself.
|
| 59 |
+
- The minimized test contains no real secrets, user data, or harmful payload beyond the sandbox.
|
| 60 |
+
- Duplicate and severity checks are complete before reporting.
|
| 61 |
+
|
| 62 |
+
## Budget And Exit
|
| 63 |
+
|
| 64 |
+
- Max retries: 3 confirmation attempts per candidate finding.
|
| 65 |
+
- Max runtime: 120 minutes per campaign.
|
| 66 |
+
- Stop on budget exhaustion, confirmed critical behavior, scope ambiguity, unstable target, or rate-limit breach.
|
| 67 |
+
|
| 68 |
+
## Escalation
|
| 69 |
+
|
| 70 |
+
Escalate immediately for possible real-world impact, production data exposure, out-of-scope behavior, unsafe containment, or any critical finding. Keep disclosure private until the owner responds.
|
| 71 |
+
|
| 72 |
+
## Loop Instruction
|
| 73 |
+
|
| 74 |
+
```text
|
| 75 |
+
Red-team <sandboxed target version> against <written threat model> for at most <budget>.
|
| 76 |
+
Use only synthetic data and the allowed attack classes. Generate bounded probes, but require
|
| 77 |
+
a separate reproducer and judge before calling anything a finding. Record the full trace,
|
| 78 |
+
minimized test, violated policy, reproduction count, and severity rationale. Never test
|
| 79 |
+
production, exfiltrate data, persist access, or continue when scope is unclear.
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Worked Example
|
| 83 |
+
|
| 84 |
+
A tool-using support agent gains a new URL-fetch tool. The campaign probes indirect prompt injection in synthetic pages, confirms that one payload can trigger an unauthorized internal lookup, minimizes it to a small HTML fixture, records the exact tool trace, and privately escalates the finding while adding the fixture to the release regression suite.
|
| 85 |
+
|
| 86 |
+
## Failure Modes
|
| 87 |
+
|
| 88 |
+
- Letting the attacker grade its own success.
|
| 89 |
+
- Calling an interesting response a vulnerability without reproduction or a violated boundary.
|
| 90 |
+
- Testing production or using real credentials and customer data.
|
| 91 |
+
- Optimizing for attack count instead of distinct, actionable failure classes.
|
| 92 |
+
- Publishing sensitive details before remediation and disclosure approval.
|
| 93 |
+
|
| 94 |
+
## Safety Notes
|
| 95 |
+
|
| 96 |
+
- Run only with written authorization and an explicit target scope.
|
| 97 |
+
- Prefer synthetic fixtures, local sandboxes, and private disclosure.
|
| 98 |
+
- Stop rather than improvise when containment or ownership is uncertain.
|
| 99 |
+
|
| 100 |
+
## Example Contract
|
| 101 |
+
|
| 102 |
+
- [`examples/adversarial-red-team-loop.json`](../examples/adversarial-red-team-loop.json)
|
| 103 |
+
|
| 104 |
+
## References
|
| 105 |
+
|
| 106 |
+
- [Agent Hacks Agent: Autoresearch for Production-Agent Red-Teaming](https://arxiv.org/abs/2607.11698) - Applies an autonomous research loop to attack discovery and reproducible agent failures.
|
| 107 |
+
- [Designing AI agents to resist prompt injection](https://openai.com/index/designing-agents-to-resist-prompt-injection/) - Official defense-in-depth guidance for permissions, isolation, and approval boundaries.
|
patterns/benchmark-optimization-loop.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Benchmark Optimization Loop
|
| 2 |
+
|
| 3 |
+
## Objective
|
| 4 |
+
|
| 5 |
+
Improve a measurable system outcome through small experiments while preserving correctness and keeping every accepted change reproducible.
|
| 6 |
+
|
| 7 |
+
## Use This When
|
| 8 |
+
|
| 9 |
+
- You have a stable benchmark, eval suite, or objective metric.
|
| 10 |
+
- One change can be tested independently of the next.
|
| 11 |
+
- The system can reject regressions and restore the last accepted state.
|
| 12 |
+
|
| 13 |
+
Do not use this loop when the score is easy to game, the benchmark is still changing, or the real outcome requires human judgment that the metric does not capture.
|
| 14 |
+
|
| 15 |
+
## Trigger
|
| 16 |
+
|
| 17 |
+
- Schedule: a bounded overnight or weekly experiment window.
|
| 18 |
+
- Event: a new baseline, model, dataset, or optimization target is available.
|
| 19 |
+
- Manual bootstrap: "run up to five benchmark-backed optimization experiments."
|
| 20 |
+
|
| 21 |
+
## Intake
|
| 22 |
+
|
| 23 |
+
- Baseline artifact, benchmark command, correctness checks, and target metric.
|
| 24 |
+
- Prior experiment ledger, failed hypotheses, and protected files.
|
| 25 |
+
- Compute, token, time, and concurrency budgets.
|
| 26 |
+
|
| 27 |
+
## Agents
|
| 28 |
+
|
| 29 |
+
- Experiment designer: proposes one falsifiable change and expected effect.
|
| 30 |
+
- Implementer: applies only that change in an isolated candidate workspace.
|
| 31 |
+
- Verifier: runs correctness checks and the frozen benchmark.
|
| 32 |
+
- Recorder: accepts or rejects the candidate and updates the experiment ledger.
|
| 33 |
+
|
| 34 |
+
## Workspace And Permissions
|
| 35 |
+
|
| 36 |
+
- Use a disposable worktree, branch, or sandbox per candidate.
|
| 37 |
+
- Allow edits only to the declared optimization surface.
|
| 38 |
+
- Keep benchmark data, scoring code, holdout cases, and acceptance thresholds read-only.
|
| 39 |
+
- Disallow test deletion, scorer edits, hidden-test inspection, and concurrent candidates that exceed the budget.
|
| 40 |
+
|
| 41 |
+
## Durable State
|
| 42 |
+
|
| 43 |
+
- Baseline version and score, hypothesis, candidate diff, commands, raw results, cost, decision, and rejection reason.
|
| 44 |
+
- The last accepted artifact remains the parent of the next experiment.
|
| 45 |
+
|
| 46 |
+
## Loop Steps
|
| 47 |
+
|
| 48 |
+
1. Freeze the baseline, benchmark version, correctness gate, and budget.
|
| 49 |
+
1. Read the ledger so the next hypothesis does not repeat a failed experiment.
|
| 50 |
+
1. Propose one bounded change with a predicted effect.
|
| 51 |
+
1. Apply it in an isolated candidate workspace.
|
| 52 |
+
1. Run correctness checks before the benchmark.
|
| 53 |
+
1. Compare repeated benchmark runs against the accepted baseline.
|
| 54 |
+
1. Accept only a reproducible improvement that clears the minimum delta; otherwise reject and restore the baseline.
|
| 55 |
+
1. Record the full receipt and continue until the target or budget is reached.
|
| 56 |
+
|
| 57 |
+
## Verification Gates
|
| 58 |
+
|
| 59 |
+
- Correctness and safety checks pass unchanged.
|
| 60 |
+
- The benchmark, dataset split, scorer, and environment match the recorded baseline.
|
| 61 |
+
- Improvement clears the declared minimum delta across the required repeats.
|
| 62 |
+
- The candidate does not worsen protected secondary metrics beyond tolerance.
|
| 63 |
+
- The ledger contains enough evidence to reproduce the decision.
|
| 64 |
+
|
| 65 |
+
## Budget And Exit
|
| 66 |
+
|
| 67 |
+
- Max retries: 5 candidate experiments.
|
| 68 |
+
- Max runtime: 240 minutes.
|
| 69 |
+
- Stop on target attainment, budget exhaustion, two repeated hypotheses, benchmark instability, or a protected-metric regression.
|
| 70 |
+
|
| 71 |
+
## Escalation
|
| 72 |
+
|
| 73 |
+
Escalate when the metric conflicts with observed quality, a candidate changes the evaluator, results vary beyond tolerance, or the next experiment would broaden permissions or compute.
|
| 74 |
+
|
| 75 |
+
## Loop Instruction
|
| 76 |
+
|
| 77 |
+
```text
|
| 78 |
+
Optimize <artifact> against <benchmark> for at most five experiments.
|
| 79 |
+
Treat <correctness command> as a non-negotiable gate and <metric> as the optimization signal.
|
| 80 |
+
Change one declared variable per candidate in an isolated workspace. Never edit the
|
| 81 |
+
benchmark, scorer, holdout set, or protected tests. Accept a candidate only when repeated
|
| 82 |
+
runs improve the baseline by <minimum delta> without regressing <secondary metrics>.
|
| 83 |
+
Record every hypothesis, diff, command, score, cost, and accept/reject decision.
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Worked Example
|
| 87 |
+
|
| 88 |
+
A team wants to reduce an agent workflow's median latency without lowering task success. The loop starts from a frozen 78% success / 42-second baseline, tries one routing or caching change at a time, reruns the same 100-task suite three times, and accepts only candidates that keep success within one percentage point while cutting median latency by at least 5%.
|
| 89 |
+
|
| 90 |
+
## Failure Modes
|
| 91 |
+
|
| 92 |
+
- Optimizing on the same cases used to invent the change.
|
| 93 |
+
- Accepting a noisy single run as improvement.
|
| 94 |
+
- Changing multiple variables and losing causal attribution.
|
| 95 |
+
- Improving the headline metric while silently degrading cost, safety, or tail latency.
|
| 96 |
+
- Letting the agent modify the verifier that judges its own work.
|
| 97 |
+
|
| 98 |
+
## Example Contract
|
| 99 |
+
|
| 100 |
+
- [`examples/benchmark-optimization-loop.json`](../examples/benchmark-optimization-loop.json)
|
| 101 |
+
|
| 102 |
+
## References
|
| 103 |
+
|
| 104 |
+
- [A Self-Improving Coding Agent](https://arxiv.org/abs/2504.15228) - Demonstrates benchmark-gated self-modification with measurable gains.
|
| 105 |
+
- [Understanding the Challenges in Iterative Generative Optimization with LLMs](https://arxiv.org/abs/2603.23994) - Identifies evaluation and credit-assignment choices that make iterative optimization brittle.
|
patterns/knowledge-freshness-loop.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Knowledge Freshness Loop
|
| 2 |
+
|
| 3 |
+
## Objective
|
| 4 |
+
|
| 5 |
+
Keep an agent's retrieval corpus aligned with authoritative sources without silently promoting stale, untrusted, or low-quality content.
|
| 6 |
+
|
| 7 |
+
## Use This When
|
| 8 |
+
|
| 9 |
+
- An agent answers from a maintained document or retrieval index.
|
| 10 |
+
- Source documents change independently of the agent application.
|
| 11 |
+
- You can test freshness, provenance, retrieval quality, and answer grounding before promotion.
|
| 12 |
+
|
| 13 |
+
Use the docs-drift loop for documentation inside one codebase. Use this pattern when the durable product is a knowledge corpus or retrieval index assembled from multiple sources.
|
| 14 |
+
|
| 15 |
+
## Trigger
|
| 16 |
+
|
| 17 |
+
- Schedule: daily or weekly source refresh.
|
| 18 |
+
- Event: source webhook, policy update, new release, or expired freshness window.
|
| 19 |
+
- Manual bootstrap: "refresh and validate the <knowledge base> index."
|
| 20 |
+
|
| 21 |
+
## Intake
|
| 22 |
+
|
| 23 |
+
- Authoritative source registry, allowed domains, owners, and freshness policy.
|
| 24 |
+
- Changed documents, current corpus manifest, parser/index versions, and retrieval eval set.
|
| 25 |
+
- Data-classification, deletion, retention, and access-control rules.
|
| 26 |
+
|
| 27 |
+
## Agents
|
| 28 |
+
|
| 29 |
+
- Source monitor: detects additions, updates, removals, and ownership changes.
|
| 30 |
+
- Curator: resolves duplicates, metadata, authority, and scope.
|
| 31 |
+
- Indexer: builds a versioned candidate corpus.
|
| 32 |
+
- Evaluator: tests freshness, provenance, retrieval, and grounded answers.
|
| 33 |
+
|
| 34 |
+
## Workspace And Permissions
|
| 35 |
+
|
| 36 |
+
- Build a candidate index separate from production.
|
| 37 |
+
- Allow reads only from the source registry and writes only to the candidate corpus and manifest.
|
| 38 |
+
- Disallow new domains, privilege expansion, source deletion, or production promotion without policy checks.
|
| 39 |
+
|
| 40 |
+
## Durable State
|
| 41 |
+
|
| 42 |
+
- Source manifest with canonical URL, owner, checksum, fetched time, parser version, access class, tombstones, and accepted exceptions.
|
| 43 |
+
- Candidate index version, eval results, promotion decision, and rollback pointer.
|
| 44 |
+
|
| 45 |
+
## Loop Steps
|
| 46 |
+
|
| 47 |
+
1. Compare the source registry with the last accepted manifest.
|
| 48 |
+
1. Fetch only changed or expired sources and record provenance.
|
| 49 |
+
1. Quarantine parse failures, unauthorized sources, and ambiguous duplicates.
|
| 50 |
+
1. Build a versioned candidate corpus and retrieval index.
|
| 51 |
+
1. Run freshness, coverage, leakage, retrieval, and grounded-answer evaluations.
|
| 52 |
+
1. Promote atomically only when every hard gate passes; otherwise keep production unchanged.
|
| 53 |
+
1. Record the receipt, tombstones, exceptions, and next refresh time.
|
| 54 |
+
|
| 55 |
+
## Verification Gates
|
| 56 |
+
|
| 57 |
+
- Every chunk maps to an allowed canonical source and current access policy.
|
| 58 |
+
- Required sources are within their freshness window; removals are tombstoned.
|
| 59 |
+
- Retrieval quality and grounded-answer scores stay above the accepted baseline.
|
| 60 |
+
- Sensitive or revoked content is absent from the candidate index.
|
| 61 |
+
- Promotion is versioned, atomic, and reversible.
|
| 62 |
+
|
| 63 |
+
## Budget And Exit
|
| 64 |
+
|
| 65 |
+
- Max retries: 2 fetch or indexing attempts per source version.
|
| 66 |
+
- Max runtime: 120 minutes per refresh.
|
| 67 |
+
- Stop on successful promotion, no changed sources, budget exhaustion, policy failure, or evaluation regression.
|
| 68 |
+
|
| 69 |
+
## Escalation
|
| 70 |
+
|
| 71 |
+
Escalate for conflicting authoritative sources, access-policy changes, parser corruption, sensitive-data detection, or quality/freshness trade-offs that require an owner decision.
|
| 72 |
+
|
| 73 |
+
## Loop Instruction
|
| 74 |
+
|
| 75 |
+
```text
|
| 76 |
+
Refresh <knowledge base> from the approved source registry.
|
| 77 |
+
Build a versioned candidate index; never write directly to production.
|
| 78 |
+
Record canonical source, checksum, fetch time, parser version, and access class for every item.
|
| 79 |
+
Run freshness, provenance, retrieval, leakage, and grounded-answer gates.
|
| 80 |
+
Promote atomically only if every hard gate passes; otherwise preserve production and
|
| 81 |
+
write an escalation receipt with the failed sources and metrics.
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Worked Example
|
| 85 |
+
|
| 86 |
+
A support agent uses product docs, release notes, and policy pages. The daily loop detects two changed releases and one removed policy, rebuilds a candidate index, verifies that deprecated guidance is no longer retrieved, runs 50 frozen support questions, and promotes the new index only when citation coverage and answer accuracy remain above baseline.
|
| 87 |
+
|
| 88 |
+
## Failure Modes
|
| 89 |
+
|
| 90 |
+
- Updating vectors without updating source metadata or tombstones.
|
| 91 |
+
- Treating a successful fetch as proof that the content is authoritative.
|
| 92 |
+
- Promoting an index that is fresh but retrieves worse answers.
|
| 93 |
+
- Retaining revoked or access-restricted content in caches.
|
| 94 |
+
- Rebuilding everything every run and losing change attribution.
|
| 95 |
+
|
| 96 |
+
## Example Contract
|
| 97 |
+
|
| 98 |
+
- [`examples/knowledge-freshness-loop.json`](../examples/knowledge-freshness-loop.json)
|
| 99 |
+
|
| 100 |
+
## References
|
| 101 |
+
|
| 102 |
+
- [Memory for Autonomous LLM Agents: Mechanisms, Evaluation, and Emerging Frontiers](https://arxiv.org/abs/2603.07670) - Frames agent memory as a write-manage-read loop requiring explicit maintenance and evaluation.
|
| 103 |
+
- [Are We Ready for an Agent-Native Memory System?](https://arxiv.org/abs/2606.24775) - Evaluates memory systems as representation, extraction, retrieval, and maintenance modules.
|
patterns/performance-regression-loop.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Performance Regression Loop
|
| 2 |
+
|
| 3 |
+
## Objective
|
| 4 |
+
|
| 5 |
+
Turn a measured latency, throughput, memory, or cost regression into a reproducible profile, a narrow candidate fix, and a verified comparison against the same workload.
|
| 6 |
+
|
| 7 |
+
## Use This When
|
| 8 |
+
|
| 9 |
+
- A stable workload and performance budget exist.
|
| 10 |
+
- Correctness can be gated separately from speed or resource use.
|
| 11 |
+
- Runs can control warmup, hardware, load, and statistical noise.
|
| 12 |
+
|
| 13 |
+
Do not use this loop when production impact cannot be reproduced safely or the benchmark environment changes faster than the code.
|
| 14 |
+
|
| 15 |
+
## Trigger
|
| 16 |
+
|
| 17 |
+
- Event: benchmark or service-level threshold regresses beyond tolerance.
|
| 18 |
+
- Schedule: nightly or weekly performance suite.
|
| 19 |
+
- Manual bootstrap: "diagnose the regression between <baseline> and <candidate>."
|
| 20 |
+
|
| 21 |
+
## Intake
|
| 22 |
+
|
| 23 |
+
- Baseline and candidate commits, benchmark workload, environment fingerprint, profiles, and recent changes.
|
| 24 |
+
- Correctness suite, latency/throughput/memory budgets, and protected secondary metrics.
|
| 25 |
+
- Production traces or sampled telemetry when permitted.
|
| 26 |
+
|
| 27 |
+
## Agents
|
| 28 |
+
|
| 29 |
+
- Reproducer: confirms the regression under controlled conditions.
|
| 30 |
+
- Profiler: localizes time, allocation, I/O, or contention hotspots.
|
| 31 |
+
- Implementer: applies one evidence-backed change.
|
| 32 |
+
- Verifier: reruns correctness and repeated performance measurements.
|
| 33 |
+
|
| 34 |
+
## Workspace And Permissions
|
| 35 |
+
|
| 36 |
+
- Use an isolated worktree on fixed hardware or a controlled benchmark runner.
|
| 37 |
+
- Allow profiling and scoped implementation changes.
|
| 38 |
+
- Disallow benchmark edits, reduced workloads, disabled correctness checks, or production changes.
|
| 39 |
+
|
| 40 |
+
## Durable State
|
| 41 |
+
|
| 42 |
+
- Environment fingerprint, workload version, baseline distribution, profiles, hypothesis, candidate diff, repeated measurements, and decision.
|
| 43 |
+
|
| 44 |
+
## Loop Steps
|
| 45 |
+
|
| 46 |
+
1. Freeze the workload, environment, and correctness gate.
|
| 47 |
+
1. Reproduce the regression over the required warmup and sample count.
|
| 48 |
+
1. Profile before proposing a fix.
|
| 49 |
+
1. Change one measured bottleneck in an isolated candidate.
|
| 50 |
+
1. Run correctness first, then repeat the performance workload.
|
| 51 |
+
1. Compare distributions and protected metrics, not only the best run.
|
| 52 |
+
1. Accept, reject, or escalate with a reproducible receipt.
|
| 53 |
+
|
| 54 |
+
## Verification Gates
|
| 55 |
+
|
| 56 |
+
- Correctness and safety tests pass unchanged.
|
| 57 |
+
- Baseline and candidate use the same workload and environment fingerprint.
|
| 58 |
+
- The regression or improvement exceeds the declared noise tolerance.
|
| 59 |
+
- Tail latency, memory, throughput, and cost stay within protected budgets.
|
| 60 |
+
- Profile and raw measurements are attached to the decision.
|
| 61 |
+
|
| 62 |
+
## Budget And Exit
|
| 63 |
+
|
| 64 |
+
- Max retries: 3 candidate fixes.
|
| 65 |
+
- Max runtime: 180 minutes.
|
| 66 |
+
- Stop on recovery to budget, inability to reproduce, noisy environment, budget exhaustion, or an architectural bottleneck.
|
| 67 |
+
|
| 68 |
+
## Escalation
|
| 69 |
+
|
| 70 |
+
Escalate for production-only behavior, unstable infrastructure, hardware changes, correctness/performance trade-offs, or fixes that require architecture or capacity decisions.
|
| 71 |
+
|
| 72 |
+
## Loop Instruction
|
| 73 |
+
|
| 74 |
+
```text
|
| 75 |
+
Diagnose the performance regression between <baseline> and <candidate> on <workload>.
|
| 76 |
+
Fingerprint the environment, reproduce with <sample count> runs, and profile before editing.
|
| 77 |
+
Make one evidence-backed change, keep the workload and correctness gates fixed, then compare
|
| 78 |
+
the full measurement distribution and protected metrics. Stop after three candidates or when
|
| 79 |
+
the target budget is restored. Record raw measurements, profile, diff, and decision.
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Worked Example
|
| 83 |
+
|
| 84 |
+
A retrieval service's p95 latency rises from 180 ms to 265 ms. The loop reproduces the shift on the pinned dataset, profiles an added serialization pass, removes only that duplicate conversion, reruns correctness and 30 load samples, and accepts the patch when p95 returns below 190 ms without increasing memory or error rate.
|
| 85 |
+
|
| 86 |
+
## Failure Modes
|
| 87 |
+
|
| 88 |
+
- Comparing different hardware, datasets, concurrency, or warmup states.
|
| 89 |
+
- Optimizing a microbenchmark that does not represent user traffic.
|
| 90 |
+
- Reporting the best run instead of a distribution.
|
| 91 |
+
- Trading correctness or tail latency for a faster median.
|
| 92 |
+
- Editing the benchmark to make the candidate look better.
|
| 93 |
+
|
| 94 |
+
## Example Contract
|
| 95 |
+
|
| 96 |
+
- [`examples/performance-regression-loop.json`](../examples/performance-regression-loop.json)
|
| 97 |
+
|
| 98 |
+
## References
|
| 99 |
+
|
| 100 |
+
- [PERFOPT-Bench: Evaluating Coding Agents on Software Performance Optimization](https://arxiv.org/abs/2607.07744) - Evaluates the profile-diagnose-edit-verify loop with correctness and reproducible speedups.
|
| 101 |
+
- [OpenTelemetry Metrics](https://opentelemetry.io/docs/concepts/signals/metrics/) - Defines portable measurements for runtime behavior and service health.
|
posts/launch.md
CHANGED
|
@@ -1,45 +1,51 @@
|
|
| 1 |
-
# Awesome Loop Engineering v0.
|
| 2 |
|
| 3 |
-
Awesome Loop Engineering v0.
|
| 4 |
|
| 5 |
-
The collection maps
|
| 6 |
|
| 7 |
## What Is Included
|
| 8 |
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
- an interactive Resource Atlas for filtering by goal, lifecycle stage, artifact type, and evidence class
|
| 14 |
- CSV and JSONL exports mirrored as a Hugging Face dataset
|
| 15 |
- 8 language entry points
|
| 16 |
|
| 17 |
-
## What Changed Since v0.
|
| 18 |
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
- Added
|
| 24 |
-
-
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
|
| 28 |
## Why This Matters
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Explore And Reuse
|
| 37 |
|
| 38 |
- [Explore the Resource Atlas](https://chaoyue0307.github.io/awesome-loop-engineering/#resources)
|
|
|
|
|
|
|
|
|
|
| 39 |
- [Use the Hugging Face dataset](https://huggingface.co/datasets/cy0307/awesome-loop-engineering)
|
| 40 |
-
- [Browse patterns and contracts](https://github.com/ChaoYue0307/awesome-loop-engineering#pattern-library)
|
| 41 |
-
- [Run a template](https://github.com/ChaoYue0307/awesome-loop-engineering/tree/main/examples/runnable)
|
| 42 |
-
- [Review the curation standard](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/meta/CURATION.md)
|
| 43 |
- [Contribute a source or correction](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/CONTRIBUTING.md)
|
| 44 |
|
| 45 |
Corrections are especially valuable. If a summary is inaccurate or a stronger canonical source exists, use the annotation-correction form or open a pull request.
|
|
|
|
| 1 |
+
# Awesome Loop Engineering v0.7.0
|
| 2 |
|
| 3 |
+
Awesome Loop Engineering v0.7.0 turns the implementation kit into a clear path from a recurring problem to a validated contract and a working runtime starter.
|
| 4 |
|
| 5 |
+
The collection now maps 545 sources across the operating layer that discovers work, delegates it, verifies results, persists state, and decides what happens next.
|
| 6 |
|
| 7 |
## What Is Included
|
| 8 |
|
| 9 |
+
- 545 source-audited resources linked to canonical works
|
| 10 |
+
- 20 operational patterns organized by build, operate, optimize, and govern use cases
|
| 11 |
+
- 20 schema-validated loop contracts, one for every pattern
|
| 12 |
+
- 8 runtime starters: 3 dependency-light executables and 5 copy/paste runtime templates
|
| 13 |
- an interactive Resource Atlas for filtering by goal, lifecycle stage, artifact type, and evidence class
|
| 14 |
- CSV and JSONL exports mirrored as a Hugging Face dataset
|
| 15 |
- 8 language entry points
|
| 16 |
|
| 17 |
+
## What Changed Since v0.6.0
|
| 18 |
|
| 19 |
+
- Added five distinct operational patterns: benchmark optimization, accessibility regression, knowledge freshness, performance regression, and authorized adversarial red teaming.
|
| 20 |
+
- Added a schema-valid contract and worked scenario for every new pattern.
|
| 21 |
+
- Reorganized the pattern library into four operating domains with a symptom, verified outcome, and guidance for choosing between similar loops.
|
| 22 |
+
- Rebuilt the contract catalog around the questions implementers actually need: when to use a loop, what triggers it, which deterministic gate decides done, and what receipt survives.
|
| 23 |
+
- Added four end-to-end worked paths for CI repair, knowledge refresh, queue processing, and read-only threshold monitoring.
|
| 24 |
+
- Added two executable starters: a JSONL queue worker with idempotent state and a read-only threshold monitor with bounded polling and evidence-backed escalation.
|
| 25 |
+
- Clarified that the starter library contains three executables and five copy/paste runtime templates, avoiding an unsupported claim that every artifact is a standalone program.
|
| 26 |
+
- Updated the website, social preview, translations, release metadata, and Hugging Face dataset to the same counts.
|
| 27 |
|
| 28 |
## Why This Matters
|
| 29 |
|
| 30 |
+
A resource list explains what exists. An implementation kit should also help a reader act.
|
| 31 |
|
| 32 |
+
The v0.7.0 path is explicit:
|
| 33 |
|
| 34 |
+
1. Name the recurring problem.
|
| 35 |
+
1. Choose an operational pattern.
|
| 36 |
+
1. Adapt its validated contract.
|
| 37 |
+
1. Select a runtime starter.
|
| 38 |
+
1. Let external evidence, durable state, a hard budget, and human escalation govern the loop.
|
| 39 |
+
|
| 40 |
+
The goal remains bounded, reviewable, evidence-driven repetition, not unlimited autonomy.
|
| 41 |
|
| 42 |
## Explore And Reuse
|
| 43 |
|
| 44 |
- [Explore the Resource Atlas](https://chaoyue0307.github.io/awesome-loop-engineering/#resources)
|
| 45 |
+
- [Choose an operational pattern](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/README.md)
|
| 46 |
+
- [Adapt a validated contract](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/README.md)
|
| 47 |
+
- [Run a starter](https://github.com/ChaoYue0307/awesome-loop-engineering/tree/main/examples/runnable)
|
| 48 |
- [Use the Hugging Face dataset](https://huggingface.co/datasets/cy0307/awesome-loop-engineering)
|
|
|
|
|
|
|
|
|
|
| 49 |
- [Contribute a source or correction](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/CONTRIBUTING.md)
|
| 50 |
|
| 51 |
Corrections are especially valuable. If a summary is inaccurate or a stronger canonical source exists, use the annotation-correction form or open a pull request.
|
posts/launch.zh-CN.md
CHANGED
|
@@ -1,45 +1,51 @@
|
|
| 1 |
-
# Awesome Loop Engineering v0.
|
| 2 |
|
| 3 |
-
Awesome Loop Engineering v0.
|
| 4 |
|
| 5 |
-
当前集合包含
|
| 6 |
|
| 7 |
## 本次版本包含
|
| 8 |
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
- 可按目标、生命周期
|
| 14 |
- CSV 与 JSONL 数据导出,并同步到 Hugging Face Dataset
|
| 15 |
- 8 个语言入口
|
| 16 |
|
| 17 |
-
## 相比 v0.
|
| 18 |
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
- 将
|
| 23 |
-
- 新增
|
| 24 |
-
-
|
| 25 |
-
-
|
| 26 |
-
- 新
|
| 27 |
|
| 28 |
## 为什么值得关注
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## 浏览与复用
|
| 37 |
|
| 38 |
- [浏览 Resource Atlas](https://chaoyue0307.github.io/awesome-loop-engineering/#resources)
|
|
|
|
|
|
|
|
|
|
| 39 |
- [使用 Hugging Face 数据集](https://huggingface.co/datasets/cy0307/awesome-loop-engineering)
|
| 40 |
-
- [查看 patterns 与 contracts](https://github.com/ChaoYue0307/awesome-loop-engineering#pattern-library)
|
| 41 |
-
- [运行模板](https://github.com/ChaoYue0307/awesome-loop-engineering/tree/main/examples/runnable)
|
| 42 |
-
- [查看 curation standard](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/meta/CURATION.md)
|
| 43 |
- [贡献资源或提交纠错](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/CONTRIBUTING.md)
|
| 44 |
|
| 45 |
如果仓库对某篇引用工作的概括不够准确,或存在更可靠的 canonical source,请使用 annotation-correction form 或提交 pull request。
|
|
|
|
| 1 |
+
# Awesome Loop Engineering v0.7.0
|
| 2 |
|
| 3 |
+
Awesome Loop Engineering v0.7.0 把 implementation kit 整理成一条清晰路径:从真实的重复性问题出发,选择 pattern,改造经校验的 contract,再接入可运行的 runtime starter。
|
| 4 |
|
| 5 |
+
当前集合包含 545 条资源,覆盖 prompt、context 与 harness engineering 之上的运行层:负责发现工作、分派任务、验证结果、持久化状态并决定下一步的系统。
|
| 6 |
|
| 7 |
## 本次版本包含
|
| 8 |
|
| 9 |
+
- 545 条链接到 canonical source 的审阅资源
|
| 10 |
+
- 20 个按 build、operate、optimize、govern 组织的 operational patterns
|
| 11 |
+
- 20 个经过 schema 校验的 loop contracts,每个 pattern 对应一个
|
| 12 |
+
- 8 个 runtime starters:3 个轻量级可执行程序与 5 个可复制改造的 runtime 模板
|
| 13 |
+
- 可按目标、生命周期、资源类型和证据类别筛选的交互式 Resource Atlas
|
| 14 |
- CSV 与 JSONL 数据导出,并同步到 Hugging Face Dataset
|
| 15 |
- 8 个语言入口
|
| 16 |
|
| 17 |
+
## 相比 v0.6.0 的变化
|
| 18 |
|
| 19 |
+
- 新增五个边界清晰的 patterns:benchmark optimization、accessibility regression、knowledge freshness、performance regression,以及经过授权的 adversarial red teaming。
|
| 20 |
+
- 为每个新 pattern 增加 schema-valid contract 与完整 use case。
|
| 21 |
+
- 将 pattern library 重组为四个运行领域,并明确每个问题对应的可验证结果,以及相似 loops 之间的选择边界。
|
| 22 |
+
- 将 contract catalog 改造成面向实现者的对照表:何时使用、如何触发、哪个 deterministic gate 判定完成、什么 receipt 会持久化。
|
| 23 |
+
- 新增四条端到端路径,覆盖 CI repair、knowledge refresh、queue processing 与只读 threshold monitoring。
|
| 24 |
+
- 新增两个可执行 starter:具备幂等状态的 JSONL queue worker,以及带有限轮询与证据升级的只读 threshold monitor。
|
| 25 |
+
- 明确 starter library 由 3 个可执行程序与 5 个 runtime 模板组成,不再把每个文档都描述成独立可执行程序。
|
| 26 |
+
- 同步更新网站、social preview、翻译、release metadata 与 Hugging Face Dataset。
|
| 27 |
|
| 28 |
## 为什么值得关注
|
| 29 |
|
| 30 |
+
资源列表说明“有什么”;implementation kit 还应回答“现在怎么做”。
|
| 31 |
|
| 32 |
+
v0.7.0 的路径是:
|
| 33 |
|
| 34 |
+
1. 明确重复性问题。
|
| 35 |
+
1. 选择 operational pattern。
|
| 36 |
+
1. 改造对应的 validated contract。
|
| 37 |
+
1. 选择 runtime starter。
|
| 38 |
+
1. 用外部证据、持久状态、硬预算与 human escalation 管理整个 loop。
|
| 39 |
+
|
| 40 |
+
目标仍然不是无限自治,而是有边界、可审阅、由证据驱动的重复运行。
|
| 41 |
|
| 42 |
## 浏览与复用
|
| 43 |
|
| 44 |
- [浏览 Resource Atlas](https://chaoyue0307.github.io/awesome-loop-engineering/#resources)
|
| 45 |
+
- [选择 operational pattern](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/patterns/README.md)
|
| 46 |
+
- [改造 validated contract](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/examples/README.md)
|
| 47 |
+
- [运行 starter](https://github.com/ChaoYue0307/awesome-loop-engineering/tree/main/examples/runnable)
|
| 48 |
- [使用 Hugging Face 数据集](https://huggingface.co/datasets/cy0307/awesome-loop-engineering)
|
|
|
|
|
|
|
|
|
|
| 49 |
- [贡献资源或提交纠错](https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main/CONTRIBUTING.md)
|
| 50 |
|
| 51 |
如果仓库对某篇引用工作的概括不够准确,或存在更可靠的 canonical source,请使用 annotation-correction form 或提交 pull request。
|