{
  "$defs": {
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "LifecycleEvent": {
      "description": "The 19 typed lifecycle events an entity can undergo.\n\nEach event records *when* it took legal effect (the notary deed date,\nthe registry-entry date, the resolution effective date). The\nappend-only log resolves the current entity status (`StatusActive`) by\nfolding from `formation_deed` through the latest unreversed event.",
      "oneOf": [
        {
          "const": "formation_deed",
          "description": "Gründungsurkunde / signed certificate of incorporation. Entity\nexists in formation (i.G.) from this date onward.",
          "type": "string"
        },
        {
          "const": "registry_entry",
          "description": "Handelsregister eintragung / state filing acceptance. Entity gains\nfull legal personality.",
          "type": "string"
        },
        {
          "const": "capital_paid_in",
          "description": "Stammkapital deposit confirmation / bank-letter receipt.",
          "type": "string"
        },
        {
          "const": "capital_increase",
          "description": "Kapitalerhöhung — share-capital increase.",
          "type": "string"
        },
        {
          "const": "capital_decrease",
          "description": "Kapitalherabsetzung — share-capital decrease.",
          "type": "string"
        },
        {
          "const": "dormancy_declared",
          "description": "Formal dormancy declaration.",
          "type": "string"
        },
        {
          "const": "dormancy_lifted",
          "description": "Lift dormancy, return to active operations.",
          "type": "string"
        },
        {
          "const": "merger_into",
          "description": "Verschmelzung — this entity is absorbed by the counterparty\n(this entity ceases to exist).",
          "type": "string"
        },
        {
          "const": "merger_of",
          "description": "Verschmelzung — this entity absorbs the counterparty\n(counterparty ceases to exist).",
          "type": "string"
        },
        {
          "const": "demerger",
          "description": "Spaltung / Aufspaltung / Ausgliederung — demerger.",
          "type": "string"
        },
        {
          "const": "acquisition_by",
          "description": "Share-acquisition by the counterparty (control change). The entity\ncontinues to exist; ownership shifts.",
          "type": "string"
        },
        {
          "const": "conversion",
          "description": "Formwechsel — change of legal form (GmbH → AG, UG → GmbH,\nLLC → C-Corp flip per BDR 0042).",
          "type": "string"
        },
        {
          "const": "redomiciliation",
          "description": "Sitzverlegung across jurisdictions.",
          "type": "string"
        },
        {
          "const": "liquidation_resolved",
          "description": "Auflösungsbeschluss — resolution to liquidate.",
          "type": "string"
        },
        {
          "const": "liquidation_started",
          "description": "Eintritt in Liquidation — liquidator appointed.",
          "type": "string"
        },
        {
          "const": "liquidation_completed",
          "description": "Löschung wegen Vermögenslosigkeit / liquidation complete.",
          "type": "string"
        },
        {
          "const": "deregistration",
          "description": "Registry deletion.",
          "type": "string"
        },
        {
          "const": "registered_seat_change",
          "description": "Sitzverlegung within jurisdiction (HRB change but same court).",
          "type": "string"
        },
        {
          "const": "name_change",
          "description": "Statutory name change.",
          "type": "string"
        },
        {
          "const": "share_class_created",
          "description": "New share class created (cross-references BDR 0067 cap-table event).",
          "type": "string"
        },
        {
          "const": "share_class_retired",
          "description": "Share class retired.",
          "type": "string"
        }
      ]
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/entity-lifecycle.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Append-only lifecycle event record. File layout:\n`.corpospec/entity/lifecycle/<entity>/<YYYY-MM-DD>-<event>.yaml`.\n\nNever overwrite an existing file; corrections post a sibling\n`correction` event referencing the original via the `corrects`\noptional field.",
  "properties": {
    "content_hash": {
      "description": "SHA-256 of the canonicalised event payload (excluding this field).\nEstablishes immutability outside Git.",
      "type": "string"
    },
    "corrects": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "When this event corrects an earlier event (rare; typically resolved\nvia a sibling note rather than correction)."
    },
    "counterparty": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "Counterparty for merger / acquisition / demerger events."
    },
    "document": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef into `legal/contracts/<slug>` for the deed, resolution, or\ncertificate."
    },
    "effective_date": {
      "$ref": "#/$defs/IsoDate",
      "description": "When the event takes legal effect (notary deed date,\nregistry-entry date, resolution date)."
    },
    "entity": {
      "$ref": "#/$defs/PathRef",
      "description": "The subject entity."
    },
    "event": {
      "$ref": "#/$defs/LifecycleEvent",
      "description": "Which event this record captures."
    },
    "git_commit_sha": {
      "description": "Git commit SHA recorded by the pre-commit hook.",
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef identifier, conventionally\n`entity/lifecycle/<entity>/<YYYY-MM-DD>-<event>`."
    },
    "note": {
      "description": "Free-form note.",
      "type": [
        "string",
        "null"
      ]
    },
    "recorded_date": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the record was authored. Defaults to commit date if unset."
    },
    "registry_reference": {
      "description": "Registry reference (e.g. \"HRB 765497 vom 2026-05-25\").",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "entity",
    "event",
    "effective_date",
    "content_hash"
  ],
  "title": "EntityLifecycleEvent",
  "type": "object",
  "x-corpospec-pillar": "entity"
}