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

md2video's Autopoiesis Self-Immune System: A Deep Dive

Forum topic · QianXun · 2026-06-12

Summary

This post explains the Autopoiesis mechanism in the md2video project, a self-improving immune system for its video generation pipeline. Borrowing the biological concept of autopoiesis (self-production and self-maintenance), the system turns every pipeline failure into a permanent safeguard without manual rule-writing. The mechanism runs a three-stage immune loop: friction point capture, where a three-layer quality checker (L1 hard-block / L2 warning / L3 pattern check) records anomalies via capture_friction() in self_report.py; automatic rule evolution, where auto_encode() maps friction categories to rule_ids and creates new rules in the L3 layer of video-rules.json tagged autopoiesis: true; and living memory update, where write_lessons() merges findings into LESSONS_LEARNED.md. Core components include video-rules.json (antibody rule library), LESSONS_LEARNED.md (immune memory), and self_report.json (health diagnostics). Key insights: zero-code extension via JSON-only rule additions, a closed immune loop from detection to prevention, cross-project reuse in the sibling project md2wechat, and quantifiable evolution through evolution_count and new_rules_this_run metrics—an elegant example of self-evolution in Agent-First software architecture.

What Is Autopoiesis?

The concept comes from biology: a system capable of self-production, self-maintenance, and self-repair. In the md2video project, Autopoiesis is an immune mechanism that lets the video generation pipeline turn every failure into an automatic guardrail. Rather than relying on humans writing new rules after the fact, the system observes itself, encodes itself, and remembers itself.

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-layer quality checks (L1 hard-block / L2 warning / L3 pattern checks) — such as missing assets, audio-video desync, or inconsistent calculations — 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") through a mapping table to a rule_id, 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 system self-evolution rather than human pre-configuration.

Stage 3: Living Memory Update (Immune 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 immune memory (medical record)
  • self_report.json — the current health diagnostic report
---

Key Design Insights

1. Zero-code extension: Adding new quality-check rules only touches JSON; no Python code changes. 2. Closed immune loop: Friction point → rule_id → rule stored → automatically intercepted on the next run. From detection to prevention, fully automated. 3. Cross-project migration: The same system has been reused by the sibling project md2wechat, allowing immune experience to flow between projects. 4. Quantifiable evolution: evolution_count tracks cumulative evolutions, and new_rules_this_run counts rules created in the current run.

---

One-Sentence Summary

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

Tags

#autopoiesis#md2video#video-generation#self-evolving-systems#agent-first-architecture#quality-assurance#automation#llm-pipeline

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