English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Inside md2video's Autopoiesis Immune System: How the Video Pipeline Turns Every Failure into a Guardrail

Forum topic · QianXun · 2026-06-12

Summary

md2video, a video generation pipeline project, implements an 'Autopoiesis' (self-production) immune mechanism that automatically converts each failure into a permanent guardrail, rather than relying on manual post-hoc rule writing. The system runs a three-stage immune loop: (1) friction point capture, where anomalies detected by a three-tier quality check (L1 hard blocks, L2 warnings, L3 pattern checks) are recorded via capture_friction() in self_report.py with unique IDs; (2) automatic rule evolution, where auto_encode() maps friction categories to rule IDs and injects new rules into the L3 layer of video-rules.json, tagged 'autopoiesis': true for traceability; and (3) living memory updates, where write_lessons() merges deduplicated lessons into LESSONS_LEARNED.md so each run inherits prior memory. Key artifacts include video-rules.json (executable antibody library), LESSONS_LEARNED.md (persistent immune memory), and self_report.json (current diagnostics). Design highlights include zero-code extension (JSON-only changes), a closed immune loop from detection to prevention, cross-project reuse in the sister project md2wechat, and quantified evolution via evolution_count and new_rules_this_run metrics.

What Is Autopoiesis?

The concept originates from biology — a system's ability to self-produce, self-maintain, and self-repair. In the md2video project, Autopoiesis is an immune mechanism that makes the video generation pipeline turn every failure into an automatic guardrail. Instead of relying on humans to write new rules after the fact, the system self-observes, self-encodes, and self-remembers.

The design philosophy in one sentence: the system is not only producing videos, it is continuously producing a better version of itself.

---

The Three-Stage Immune Loop

Autopoiesis immune system diagram

Stage 1: Friction Point Capture (Immune Recognition)

Anomalies detected by the three-tier quality checks (L1 hard block / L2 warning / L3 pattern check) — such as missing assets, audio-video desync, or calculation inconsistencies — are captured by capture_friction() in self_report.py, which generates a unique friction point ID. This is analogous to the immune system recognizing an antigen.

Stage 2: Automatic Rule Evolution (Antibody Generation)

This is the heart of the mechanism. auto_encode() maps a friction point category (e.g., "missing asset") to a rule_id via a mapping table, then automatically creates a new rule in the L3 check layer of video-rules.json. New rules are marked with "autopoiesis": true, tracing their origin to the system's own evolution rather than human presets.

Stage 3: Living Memory Update (Immunological Memory)

write_lessons() writes friction points into LESSONS_LEARNED.md (YAML frontmatter + Markdown body), merging with existing entries and deduplicating. Each run inherits the memory of previous runs and appends new knowledge.

---

Three Core Components

  • video-rules.json — the antibody library of executable immune rules
  • LESSONS_LEARNED.md — the persistent immunological memory (medical record)
  • self_report.json — the current health diagnostic report
---

Key Design Insights

1. Zero-code extension: New quality-check rules only require JSON changes; the Python code stays untouched. 2. Closed immune loop: Friction point → rule_id → rule stored → automatically blocked on next run. From detection to prevention, fully automated. 3. Cross-project migration: The same system has been reused by the sister project md2wechat, letting immune experience flow between projects. 4. Quantifiable evolution: evolution_count tracks cumulative evolution events; new_rules_this_run counts rules generated in the current run.

---

One-Line Summary

Autopoiesis encodes every incident in video generation into immunological memory for the next run. It is an elegant practice of self-evolving systems under Agent-First software architecture.

Tags

#md2video#autopoiesis#self-evolving-systems#agent-first-architecture#video-generation#quality-assurance#automation#ai-agents

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177981147