# K-14 — Autonomous loop with stop & escalation rules
# Category: KEY (Phase F)
# Kapitel: 10 – Definition of Done und autonome Loops
# Anker: Stop / Escalate bei No-Progress oder Max-N; Context-Rot bei ungebremstem Loop
# Orientierung: 16:9 landscape
# Didaktik: Vollständiges Steuerungssystem: DoD-Check + grün Commit / rot Fix mit N-Limit + Eskalation.
# Caption (DE): Autonomer Loop mit Stop und Eskalation — nicht ungebremst drehen.
# Ziel-Asset: assets/illustrations/K-14-autonomous-loop-stop-escalate.jpg
# Gate0: Imagine→SVG (Diamanten und Verzweigungen oft unzuverlässig)
# Language: English (Gemini / Imagen)
# Usage: paste entire prompt body below into Gemini
# Complements / extends: K-07 (basic DoD loop) — companion figure, does not replace K-07

--- PROMPT START ---
Create a clean autonomous agent control-loop flowchart, 16:9 landscape, for a professional practice book on coding agents and Definition of Done.

OUTPUT SPECS:
- 16:9 landscape; flat-vector flowchart; soft depth; print-ready; high contrast
- Not a photoreal IDE screenshot; not a vendor product UI

TOPIC:
Real autonomy needs machine-checkable DoD AND explicit stop/escalation rules. Unbounded loops create context rot and expensive ping-pong.

TITLE (exact):
Autonomous loop — stop & escalate
SUBTITLE (exact):
DoD gates progress — limits prevent rot

COLOR / STYLE:
- Background #F8FAFC; navy #0B1F33 boxes; teal #0D9488 connectors
- Green #16A34A for success path; amber #D97706 for fix path; red #DC2626 for stop/escalate
- Diamond decision nodes slightly rotated squares or classic diamonds
- Flat vector; generous margins

MAIN FLOW (left-to-right or top-down, clear arrows):

1. Rounded rect "Start"
2. "Select / Write" (context + change intent)
3. "Execute" (tools / edits)
4. Diamond "DoD check?"
   YES (green path) → "Commit + progress" → "End"
   NO (amber path) → "Diagnose" → "Narrow fix (max N)" → back toward Execute or DoD check
5. Second diamond on fix path: "No progress or max N?"
   YES (red) → branch split:
      a) "Escalate: stronger model"
      b) "Human + Handoff"
      c) small terminal "Stop"
   NO → loop back to Execute / DoD (only once implied by max N)

SIDE ANNOTATION (amber/red callout panel, not inside main boxes):
"Context-rot risk if loop unbounded"

OPTIONAL SMALL INSET (bottom-left, red anti-pattern, keep tiny):
"write → claim done → user: not yet → write…"
label: "ping-pong, not a loop"

TYPOGRAPHY:
- English only; short node labels; no long policy text
- Commands if any must be short: "tests exit 0" · "scope check" — optional micro-chips only under DoD check
- Never invent fake metrics dashboards

ALLOWED TEXT (priority):
- Title / subtitle
- Nodes: Start · Select / Write · Execute · DoD check? · Commit + progress · End · Diagnose · Narrow fix (max N) · No progress or max N? · Escalate: stronger model · Human + Handoff · Stop
- Side: Context-rot risk if loop unbounded
- Optional inset: ping-pong, not a loop
- Optional DoD chips: tests exit 0 · scope check

VISUAL RULES:
- One primary success path in green
- Fix loop clearly limited (max N visible)
- Escalation is a first-class exit, not an afterthought
- Do not draw infinite spiral without stop

NEGATIVE:
- robots, logos, neon, watermarks, German paragraphs, vendor model product names (use “stronger model” only)

FINAL SELF-CHECK:
DoD diamond exists. Green commit path exists. Max-N / no-progress leads to escalate or stop. Unbounded-loop warning present.
--- PROMPT END ---

# Follow-up edit:
# Preserve max N and dual escalate (stronger model OR human+Handoff).
# Keep context-rot side callout. Drop ping-pong inset if crowded.
# SVG if diamonds/branches tangle.
