{
  "schema": "aldi-telemetry-schemas/v1",
  "policy": "SECURITY-POLICY-BUILDS v1.0 §3",
  "canon": "RFC8785",
  "pii_rule": "No raw IP address or user agent is stored in new rows. Keyed hash h1:<32 hex> = first 16 bytes of HMAC-SHA256(TELEMETRY_PEPPER, value). The pepper is a Workers secret, separate from the data, and is never published. Rows written before 2026-10-09 ~17:30 PT are left untouched.",
  "tables": {
    "aldi_contrib_signals (D1 FROI_DB)": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "ts_pt",
        "endpoint",
        "contributor_org",
        "queue",
        "method",
        "confidence",
        "signals"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "ts_pt": {
          "type": "string"
        },
        "endpoint": {
          "enum": [
            "/v1/contributors/submit",
            "/v1/clips",
            "/v1/provenance"
          ]
        },
        "item_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "item_kind": {
          "type": [
            "string",
            "null"
          ]
        },
        "response_status": {
          "type": "integer"
        },
        "contributor_org": {
          "type": "string"
        },
        "queue": {
          "type": "string"
        },
        "method": {
          "enum": [
            "key",
            "principal",
            "header",
            "user_agent",
            "asn",
            "none"
          ]
        },
        "confidence": {
          "type": "number"
        },
        "signals": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "key": {
              "type": [
                "object",
                "null"
              ]
            },
            "principal": {
              "type": [
                "object",
                "null"
              ]
            },
            "header": {
              "type": [
                "string",
                "null"
              ]
            },
            "user_agent_hmac": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(h1:[0-9a-f]{32}|unkeyed)$"
            },
            "user_agent_len": {
              "type": [
                "integer",
                "null"
              ]
            },
            "ua_match": {
              "type": [
                "string",
                "null"
              ]
            },
            "asn": {
              "type": [
                "integer",
                "null"
              ]
            },
            "asn_label": {
              "type": [
                "string",
                "null"
              ]
            },
            "as_org": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    },
    "ratelimit KV keys (albertlane-apex FROI/VAULT)": {
      "pattern": "ratelimit/[sso/<kind>/]h1:<32 hex>/<YYYY-MM-DDTHH>",
      "note": "new keys use the keyed hash of the client IP; TTL-bound"
    },
    "in-memory rate limiters (both Workers)": {
      "note": "keyed by IP in isolate memory only; never written to storage"
    },
    "froi_session_audit (D1, written by another Worker)": {
      "note": "has raw ip/user_agent columns; not written by meta-lane-api or albertlane-apex; open gap"
    }
  }
}