{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "AEA Outer Harness \u2014 Decision Layer (generate \u00b7 decide \u00b7 execute)",
    "output": "outer-harness-decision-layer.architecture.html",
    "quality_profile": "showcase",
    "views": [
      {
        "id": "three-roles",
        "label": "Generate \u00b7 Decide \u00b7 Execute",
        "focus": [
          "human",
          "llm",
          "decision",
          "code",
          "sidefx"
        ],
        "note": "LLM writes; Decision Layer returns Choice\u00b7Score\u00b7Gate; code owns irreversible side effects."
      },
      {
        "id": "model-tier",
        "label": "Model-tier Choice",
        "focus": [
          "request",
          "decision",
          "cost",
          "llm"
        ],
        "note": "Before spend: Choice over model tier (Cost Guardian). Not a vendor SDK install."
      },
      {
        "id": "automode",
        "label": "AutoMode pre-tool Gate",
        "focus": [
          "llm",
          "decision",
          "park",
          "sidefx"
        ],
        "note": "Pre-tool risk Gate maps to irreversible park list (#441). Fail closed."
      },
      {
        "id": "recipes",
        "label": "Holmberg recipe families",
        "focus": [
          "vault",
          "decision",
          "sensors"
        ],
        "note": "Classify/dedupe, anti-slop Gate, post Score, SEO Score \u2014 Documented recipes (#472)."
      }
    ]
  },
  "components": [
    {
      "id": "human",
      "type": "external",
      "label": "Human / sponsor",
      "sublabel": "Goals \u00b7 taste \u00b7 sign-off",
      "pos": [
        40,
        50
      ],
      "size": [
        150,
        52
      ]
    },
    {
      "id": "request",
      "type": "cloud",
      "label": "Work request",
      "sublabel": "Task \u00b7 state \u00b7 tools",
      "pos": [
        260,
        50
      ],
      "size": [
        150,
        52
      ],
      "tag": "intake"
    },
    {
      "id": "vault",
      "type": "database",
      "label": "Shared Understanding",
      "sublabel": "Vault \u00b7 memory",
      "pos": [
        480,
        50
      ],
      "size": [
        170,
        52
      ]
    },
    {
      "id": "sensors",
      "type": "backend",
      "label": "Sensors / probes",
      "sublabel": "Honesty \u00b7 Unknown",
      "pos": [
        720,
        50
      ],
      "size": [
        150,
        52
      ]
    },
    {
      "id": "llm",
      "type": "backend",
      "label": "Generative LLM",
      "sublabel": "Write \u00b7 plan \u00b7 draft",
      "pos": [
        80,
        240
      ],
      "size": [
        170,
        56
      ],
      "tag": "System Two"
    },
    {
      "id": "decision",
      "type": "security",
      "label": "Decision Layer",
      "sublabel": "Choice \u00b7 Score \u00b7 Gate",
      "pos": [
        360,
        240
      ],
      "size": [
        190,
        56
      ],
      "tag": "System One"
    },
    {
      "id": "cost",
      "type": "cloud",
      "label": "Cost Guardian",
      "sublabel": "Model-tier Choice",
      "pos": [
        680,
        240
      ],
      "size": [
        170,
        56
      ]
    },
    {
      "id": "code",
      "type": "backend",
      "label": "Code / Domain Svcs",
      "sublabel": "Validate \u00b7 execute",
      "pos": [
        80,
        450
      ],
      "size": [
        190,
        56
      ]
    },
    {
      "id": "park",
      "type": "security",
      "label": "Park list (#441)",
      "sublabel": "Irreversible stops",
      "pos": [
        380,
        450
      ],
      "size": [
        170,
        56
      ]
    },
    {
      "id": "sidefx",
      "type": "external",
      "label": "Side effects",
      "sublabel": "Send \u00b7 publish \u00b7 pay",
      "pos": [
        680,
        450
      ],
      "size": [
        170,
        56
      ]
    }
  ],
  "boundaries": [
    {
      "kind": "region",
      "label": "Outer Harness control plane",
      "wraps": [
        "request",
        "llm",
        "decision",
        "cost",
        "code",
        "park",
        "sensors"
      ]
    },
    {
      "kind": "security-group",
      "label": "Typed judgments (not generative)",
      "wraps": [
        "decision",
        "cost",
        "park"
      ]
    }
  ],
  "connections": [
    {
      "id": "human-request",
      "from": "human",
      "to": "request",
      "label": "intent",
      "variant": "emphasis"
    },
    {
      "id": "request-llm",
      "from": "request",
      "to": "llm",
      "label": "draft / plan",
      "fromSide": "bottom",
      "toSide": "top"
    },
    {
      "id": "request-decision",
      "from": "request",
      "to": "decision",
      "label": "typed questions",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top"
    },
    {
      "id": "vault-decision",
      "from": "vault",
      "to": "decision",
      "label": "state",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "top"
    },
    {
      "id": "sensors-decision",
      "from": "sensors",
      "to": "decision",
      "label": "probe",
      "variant": "dashed",
      "fromSide": "bottom",
      "toSide": "top"
    },
    {
      "id": "decision-cost",
      "from": "decision",
      "to": "cost",
      "label": "tier Choice"
    },
    {
      "id": "llm-decision",
      "from": "llm",
      "to": "decision",
      "label": "propose tool",
      "variant": "dashed"
    },
    {
      "id": "decision-park",
      "from": "decision",
      "to": "park",
      "label": "AutoMode",
      "variant": "emphasis",
      "fromSide": "bottom",
      "toSide": "top",
      "labelAt": [
        500,
        360
      ]
    },
    {
      "id": "decision-code",
      "from": "decision",
      "to": "code",
      "label": "route / score",
      "fromSide": "left",
      "toSide": "right",
      "via": [
        [
          300,
          268
        ],
        [
          300,
          478
        ]
      ],
      "labelAt": [
        250,
        370
      ]
    },
    {
      "id": "park-sidefx",
      "from": "park",
      "to": "sidefx",
      "label": "allow / stop",
      "variant": "emphasis"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Three roles",
      "items": [
        "Generative LLM \u2014 write, plan, draft (System Two)",
        "Decision Layer \u2014 Choice \u00b7 Score \u00b7 Gate (System One)",
        "Code / Domain Services \u2014 execute; own irreversible gates"
      ]
    },
    {
      "dot": "amber",
      "title": "Middleware patterns (Documented)",
      "items": [
        "Model-tier Choice \u2014 cheapest capable model before spend (#473)",
        "AutoMode pre-tool Gate \u2014 risk check before side effects; maps #441 (#474)",
        "Not a TypeSafe/Jev Path B dependency"
      ]
    },
    {
      "dot": "emerald",
      "title": "Holmberg recipe families (#472)",
      "items": [
        "Second-brain classify + dedupe",
        "Content anti-slop / voice Gate",
        "Post Score vs history \u00b7 SEO draft vs SERP Score"
      ]
    },
    {
      "dot": "rose",
      "title": "Honesty",
      "items": [
        "Documented aid until architecture.artof.link Pages probe",
        "Documented \u2260 Live \u00b7 CloudAgent held",
        "Vendor $/tok is not AEA evidence"
      ]
    }
  ]
}
