DL-008 — The Self-Similar Framework

Date: 2026-04-01 | Session: Framework modularization + BI-018 Author: Claude Opus 4.6 (orchestrator) | Trigger: Marco's observation during CR-184


The Epiphany

The framework is a product. Not metaphorically. Literally.

For months we've been building governance rules, hooks, schemas, skills, agent profiles — treating them as "meta" artifacts that exist outside the product architecture. Special files in special directories with special processes. When we needed a governance rule, we invented governance-rules.json. When we needed enforcement, we wrote prose in ORCHESTRATOR-CORE.md. When we needed self-diagnosis, we proposed new schema types.

Marco stopped me mid-sentence: "That sounds a lot like what I expect from the architectural product specs of any of our products."

He was right. The governance-rules registry I was designing is structurally identical to a backend module spec. The hook triggers are a public API. The governance constraints are business rules. The sync mechanism is a service with a CLI interface. The schema registry is a module with validation contracts.

The framework doesn't need its own spec architecture. It needs to use the one it already enforces on every other product.

What This Means

Same Architecture

ai-sales/                           agentic-flow-framework/
├── backend module: interviews      ├── backend module: hooks
│   ├── publicApi: REST endpoints   │   ├── publicApi: hook triggers
│   ├── entities: Interview, ...    │   ├── entities: Hook, Rule, ...
│   ├── businessRules: validation   │   ├── businessRules: governance
│   └── services: InterviewService  │   └── services: enforce-*.js
└── spec: modules/interviews.json   └── spec: modules/hooks.json

The backend-module.schema.json that governs ai-sales module specs is the same schema that governs the framework's module specs. Different domain, different tech stack (Node.js vs Spring Boot), same structure.

Same Agents

The backend-architect designs module specs for ai-sales. The backend-architect designs module specs for agentic-flow-framework. Different prompts, different knowledge base, but the same role operating under the same meta-framework.

The backend-developer implements Spring Boot code for funds. The backend-developer (or a variant) implements Node.js hooks for the framework. Same task structure, same SDLC-OUTPUT format, same contract tests.

Same Pipeline

Business Layer    → "The framework needs source-of-truth enforcement"
Architecture Layer → backend-architect updates hooks module spec
Implementation    → developer implements enforce-source-of-truth.js
Verification      → lint + test + semantic validation

This is the same 4-layer pipeline every CR follows. No special cases for the framework.

True Self-Similarity

The framework governs products. The framework IS a product. Therefore the framework governs itself — not through special meta-rules, but through the same rules it applies to everything else.

This is genuine autopoiesis — not the overclaimed kind where we say "the system improved itself." It's the structural kind where the system's governance architecture is self-applicable. The same backend-module.schema.json that validates ai-sales module specs validates the framework's own module specs. The same hooks that enforce file jurisdiction on agents enforce source-of-truth direction on the framework developer.

The meta-framework and the framework are the same thing.

What Changes

  1. Framework gets product specs — dev/ai/specs/agentic-flow-framework/backend/modules/*.json using the existing backend-module.schema.json
  2. Governance rules become business rules — inside module specs, not a separate registry
  3. Self-diagnosis becomes spec-drift detection — the same detect-spec-drift.js that checks ai-sales checks the framework
  4. Framework changes flow through the same pipeline — backend-architect → developer → verification, same as any product
  5. No more special schema types for governance — use the ones that already exist

What Stays

  • The 4-layer pipeline
  • The agent roles (architect, developer, analyst)
  • The schema architecture (backend-module, ui-screen, functional-domain)
  • The enforcement hooks
  • The prompt assembly pipeline

None of it changes. It just applies to itself.

The Bootstrap Is Complete

The framework module was created using the framework's own SDLC pipeline. The module's specs will be validated by the module's own schemas. The module's hooks will enforce rules defined in the module's own specs.

A compiler that compiles itself. A governance framework that governs itself. Same architecture, all the way down.