Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/content/book/14a-loop-engineering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ Best when completeness is not known in advance. The stop rule should measure evi

Best for payments, publishing, deletion, access changes, medical or legal decisions, and other consequential actions.

### The Outcome Loop

`connect a goal metric → suggest with evidence → offer options → build in a sandbox → human approves the pull request → measure live → pause at the goal, resume if it slips`

Best for performance, accessibility, security hygiene, and conversion or latency targets that drift over time.

Every shape above ends somewhere: a test passes, the evidence is sufficient, a person says yes. The outcome loop draws its observations from the fourth kind of checker, real user behavior and production metrics over time, and those keep moving after the work is done. A page that loads quickly today can slow down next month as new features land. Reaching the goal is not the end of the story; it is the moment the loop stops building and starts watching.

That changes the contract. In place of a single stop rule, write a **watch condition** (which metric, what threshold, over what window) and a **pause and resume rule** (rest while the target holds, wake when it slips). Give the loop a **budget per cycle**, so a process that never formally ends cannot quietly spend without limit. Keep a **human gate on every change**, and measure the result only after the change ships: improvements that held, changes that did nothing, and changes that made things worse all become state the next cycle learns from.

Google Labs' [Stitch Loop](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/), announced in November 2026 as a waitlist experiment, is one recent example of this shape. It is described as a long-running product agent connected to a codebase and live product data. Each loop moves through four phases: *Suggestions* grounded in evidence, *Solutions* offered as options with tradeoffs, a *Build* step that writes code in an isolated cloud sandbox and opens it as a GitHub pull request, and a *Reflect* step that monitors live data, learns from the results, and keeps watching after the goal is met in case the metric slips. Nothing merges until a person reviews the pull request. [Pulumi Agents](https://www.pulumi.com/blog/introducing-pulumi-agents/), announced the same day, apply a similar pattern to infrastructure: the team defines a goal, constraints, and permissions, the agents run in the cloud, and they return findings and pull requests for the team to review.

<Callout type="warning" title="When the Number Becomes the Goal">
A loop that optimizes a metric can improve the number while hurting what the number stood for. This is Goodhart's law: when a measure becomes a target, it stops being a good measure. A conversion loop might learn to bury the cancel button; a latency loop might quietly drop a slow but important feature. Pair every target metric with **guard metrics** it must not worsen, such as error rates, accessibility scores, or support complaints, and keep the human approval gate even after the loop has earned your trust.
</Callout>

## Failure Modes to Design Out

<table>
Expand Down Expand Up @@ -397,6 +413,7 @@ Then identify the three most likely failure modes in your design and revise the
- [Building Effective Agents — Anthropic](https://www.anthropic.com/engineering/building-effective-agents) — evaluator-optimizer workflows, environmental feedback, stopping conditions, and guidance on when agentic complexity is justified
- [A Practical Guide to Building Agents — OpenAI](https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/) — agent runs, exit conditions, tools, guardrails, and human intervention
- [ReAct: Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629) — foundational research on interleaving actions with observations from an external environment
- [Introducing Stitch Loop (Google Labs)](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/): a long-running product agent that suggests, builds, and measures changes against live metrics, with every change reviewed as a pull request

## Summary

Expand Down
17 changes: 17 additions & 0 deletions src/content/book/ar/14a-loop-engineering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ budget: "الحد الأقصى للجولات أو الوقت أو الرموز

الأنسب للمدفوعات والنشر والحذف وتغييرات الصلاحيات والقرارات الطبية أو القانونية وسائر الإجراءات ذات العواقب الجسيمة.

### حلقة النتائج

`اربط مقياس الهدف → اقترح استناداً إلى الأدلة → اعرض الخيارات → ابنِ في بيئة معزولة → يوافق الإنسان على طلب الدمج → قِس في بيئة الإنتاج → توقف مؤقتاً عند الهدف، واستأنف إن تراجع`

الأنسب لأهداف الأداء وإمكانية الوصول والنظافة الأمنية ومعدلات التحويل أو زمن الاستجابة التي تنحرف مع مرور الوقت.

كل شكل من الأشكال السابقة ينتهي عند نقطة ما: ينجح اختبار، أو تكفي الأدلة، أو يقول إنسان نعم. أما حلقة النتائج فتستمد ملاحظاتها من النوع الرابع من الفحوص، أي سلوك المستخدمين الفعلي ومقاييس الإنتاج عبر الزمن، وهذه تظل تتحرك بعد انتهاء العمل. فالصفحة التي تُحمَّل بسرعة اليوم قد تثقل في الشهر القادم مع وصول ميزات جديدة. بلوغ الهدف إذن ليس نهاية الحكاية، بل اللحظة التي تكفّ فيها الحلقة عن البناء وتبدأ الحراسة.

وهذا يغيّر العقد. فبدلاً من قاعدة توقف واحدة، اكتب **شرط مراقبة** (أي مقياس، وأي عتبة، وعلى أي نافذة زمنية) و**قاعدة إيقاف مؤقت واستئناف** (تهدأ الحلقة ما دام الهدف صامداً، وتستيقظ حين يتراجع). امنح الحلقة **ميزانية لكل دورة**، حتى لا تتمكن عملية لا تنتهي رسمياً أبداً من الإنفاق بلا حدود في صمت. أبقِ **موافقة بشرية على كل تغيير**، ولا تقِس النتيجة إلا بعد وصول التغيير إلى الإنتاج: فالتحسينات التي صمدت، والتغييرات التي لم تفعل شيئاً، والتغييرات التي زادت الأمور سوءاً، كلها تصبح حالةً تتعلم منها الدورة التالية.

ومن الأمثلة الحديثة على هذا الشكل [Stitch Loop](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/) من Google Labs، الذي أُعلن عنه في نوفمبر 2026 كتجربة بقائمة انتظار. يوصف بأنه وكيل منتج طويل الأمد متصل بقاعدة شيفرة وببيانات المنتج الحية. تمر كل دورة بأربع مراحل: *Suggestions* (اقتراحات مبنية على الأدلة)، و*Solutions* (خيارات مع مزايا كل منها وعيوبه)، و*Build* (شيفرة تُكتب في بيئة سحابية معزولة وتُفتح كطلب دمج (pull request) على GitHub)، و*Reflect* (مراقبة البيانات الحية والتعلم من النتائج والاستمرار في المراقبة بعد بلوغ الهدف تحسباً لتراجع المقياس). ولا يُدمج شيء قبل أن يراجع إنسان طلب الدمج. أما [Pulumi Agents](https://www.pulumi.com/blog/introducing-pulumi-agents/)، التي أُعلن عنها في اليوم نفسه، فتطبق نمطاً مشابهاً على البنية التحتية: يحدد الفريق هدفاً وقيوداً وصلاحيات، ويعمل الوكلاء في السحابة، ثم يعيدون نتائج وطلبات دمج ليراجعها الفريق.

<Callout type="warning" title="حين يصبح الرقم هو الهدف">
قد تُحسّن الحلقة التي تطارد مقياساً ما الرقمَ بينما تُلحق الضرر بما كان الرقم يمثله. هذا هو قانون غودهارت: حين يصبح المقياس هدفاً، يكفّ عن أن يكون مقياساً جيداً. قد تتعلم حلقة تحسين التحويل أن تخفي زر الإلغاء، وقد تحذف حلقة تقليل زمن الاستجابة بهدوء ميزة بطيئة لكنها مهمة. اقرن كل مقياس مستهدف بـ**مقاييس حماية** لا يجوز أن تسوء، مثل معدلات الأخطاء ودرجات إمكانية الوصول وشكاوى الدعم، وأبقِ بوابة الموافقة البشرية حتى بعد أن تكسب الحلقة ثقتك.
</Callout>

## أنماط فشل يجب تصميم الحلقة لتفاديها

<table>
Expand Down Expand Up @@ -397,6 +413,7 @@ return stopWithBudgetReport(state);
- [Building Effective Agents — Anthropic](https://www.anthropic.com/engineering/building-effective-agents) — تدفقات عمل المقيّم-المحسّن، والتغذية الراجعة من البيئة، وشروط التوقف، وإرشادات حول متى يكون تعقيد الوكلاء مبرراً
- [A Practical Guide to Building Agents — OpenAI](https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/) — تشغيلات الوكيل، وشروط الخروج، والأدوات، وحواجز الحماية، والتدخل البشري
- [ReAct: Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629) — بحث تأسيسي حول المزاوجة بين الإجراءات والملاحظات القادمة من بيئة خارجية
- [Introducing Stitch Loop (Google Labs)](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/): وكيل منتج طويل الأمد يقترح التغييرات ويبنيها ويقيسها وفق مقاييس حية، مع مراجعة كل تغيير كطلب دمج

## الخلاصة

Expand Down
17 changes: 17 additions & 0 deletions src/content/book/az/14a-loop-engineering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ Tamlıq əvvəlcədən bilinməyəndə ən yaxşısıdır. Dayanma qaydası axta

Ödənişlər, dərc etmə, silmə, giriş hüququ dəyişiklikləri, tibbi və ya hüquqi qərarlar və digər ciddi nəticələri olan hərəkətlər üçün ən yaxşısıdır.

### Nəticə Dövrəsi

`hədəf göstəricini qoşun → sübuta əsaslanaraq təklif edin → seçimlər təqdim edin → sandbox-da qurun → insan pull request-i təsdiqləyir → canlı mühitdə ölçün → hədəfdə fasilə verin, geriləsə davam edin`

Zamanla sürüşən performans, əlçatanlıq, təhlükəsizlik gigiyenası, konversiya və ya gecikmə hədəfləri üçün ən yaxşısıdır.

Yuxarıdakı formaların hər biri harasa çatıb bitir: test keçir, sübutlar kifayət edir, insan razılıq verir. Nəticə dövrəsi isə müşahidələrini dördüncü növ yoxlamadan, yəni zamanla real istifadəçi davranışından və produksiya göstəricilərindən alır və bunlar iş bitdikdən sonra da dəyişməyə davam edir. Bu gün sürətlə açılan səhifə yeni funksiyalar əlavə olunduqca gələn ay yenidən ləngiyə bilər. Hədəfə çatmaq hekayənin sonu deyil: bu, dövrənin qurmağı dayandırıb keşik çəkməyə başladığı andır.

Bu, müqaviləni dəyişir. Tək bir dayanma qaydası əvəzinə **izləmə şərti** (hansı göstərici, hansı hədd, hansı zaman aralığında) və **fasilə və bərpa qaydası** (hədəf qorunduqca dincəlmək, geriləyəndə oyanmaq) yazın. Dövrəyə **hər dövr üçün ayrıca büdcə** verin ki, rəsmən heç vaxt bitməyən proses səssizcə limitsiz xərcləyə bilməsin. **Hər dəyişikliyi insan təsdiqindən keçirin** və nəticəni yalnız dəyişiklik canlıya çıxdıqdan sonra ölçün: davamlı olan təkmilləşdirmələr, heç nəyi dəyişməyən cəhdlər və vəziyyəti pisləşdirən dəyişikliklər hamısı növbəti dövrün öyrəndiyi vəziyyətə çevrilir.

Google Labs-in 2026-cı ilin noyabrında gözləmə siyahısı ilə eksperiment kimi elan etdiyi [Stitch Loop](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/) bu formanın yeni nümunələrindən biridir. O, kod bazasına və canlı məhsul məlumatlarına qoşulan, uzunmüddətli işləyən məhsul agenti kimi təsvir olunur. Hər dövr dörd mərhələdən keçir: sübuta əsaslanan *Suggestions* (təkliflər), üstünlük və çatışmazlıqları ilə seçimlər təqdim edən *Solutions* (həllər), kodu izolə edilmiş bulud sandbox-unda yazıb GitHub pull request-i kimi açan *Build* (qurma) və canlı məlumatları izləyən, nəticələrdən öyrənən, hədəfə çatdıqdan sonra da göstərici geriləyə bilər deyə nəzarəti davam etdirən *Reflect* (dəyərləndirmə) mərhələsi. İnsan pull request-i nəzərdən keçirməyənə qədər heç nə birləşdirilmir. Eyni gün təqdim olunan [Pulumi Agents](https://www.pulumi.com/blog/introducing-pulumi-agents/) oxşar yanaşmanı infrastruktura tətbiq edir: komanda məqsədi, məhdudiyyətləri və icazələri müəyyən edir, agentlər buludda işləyir və komandanın nəzərdən keçirməsi üçün tapıntılar və pull request-lər qaytarır.

<Callout type="warning" title="Rəqəm Məqsədin Özünə Çevriləndə">
Göstəricini optimallaşdıran dövrə rəqəmi yaxşılaşdırarkən həmin rəqəmin ifadə etdiyi şeyə zərər verə bilər. Bu, Qudhart qanunudur: ölçü hədəfə çevriləndə yaxşı ölçü olmaqdan çıxır. Konversiyanın arxasınca düşən dövrə ləğv düyməsini gizlətməyi öyrənə bilər; gecikməni azaltmağa çalışan dövrə yavaş, amma vacib funksiyanı səssizcə söndürə bilər. Hər hədəf göstəricini pisləşməməli olan **qoruyucu göstəricilərlə** (xəta dərəcələri, əlçatanlıq balları, dəstək şikayətləri kimi) cütləşdirin və dövrə etibarınızı qazandıqdan sonra da insan təsdiqi qapısını saxlayın.
</Callout>

## Dizaynla Aradan Qaldırılmalı Uğursuzluq Rejimləri

<table>
Expand Down Expand Up @@ -397,6 +413,7 @@ Sonra dizaynında ən ehtimallı üç uğursuzluq rejimini müəyyənləşdir v
- [Effektiv Agentlərin Qurulması — Anthropic](https://www.anthropic.com/engineering/building-effective-agents) — qiymətləndirici-optimallaşdırıcı iş axınları, mühitdən gələn əks əlaqə, dayanma şərtləri və agent mürəkkəbliyinin nə vaxt özünü doğrultduğuna dair göstərişlər
- [Agentlərin Qurulmasına dair Praktiki Bələdçi — OpenAI](https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/) — agent icraları, çıxış şərtləri, alətlər, qoruyucu mexanizmlər və insan müdaxiləsi
- [ReAct: Dil Modellərində Düşünmə və Hərəkətin Sinergiyası](https://arxiv.org/abs/2210.03629) — hərəkətlərin xarici mühitdən gələn müşahidələrlə növbələnməsinə dair fundamental tədqiqat
- [Stitch Loop-un Təqdimatı (Google Labs)](https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-loop/): canlı göstəricilərə əsasən dəyişikliklər təklif edən, quran və ölçən, hər dəyişikliyi pull request kimi nəzərdən keçirməyə təqdim edən uzunmüddətli məhsul agenti

## Xülasə

Expand Down
Loading
Loading