{
  "name": "slex-conformance",
  "packageName": "slexkit",
  "version": "0.4.0",
  "schemaVersion": "2026-06",
  "protocolVersion": "0.1",
  "logicProfileVersion": "0.1",
  "fixtures": [
    {
      "id": "valid-full-envelope",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"valid_full\", g: { count: 0 }, layout: { \"button:add\": { label: \"Add\", onclick: \"g.count++\" }, \"text:value\": { \"$text\": \"String(g.count)\" } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-dynamic-props",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"dynamic_props\", g: { name: \"Slex\" }, layout: { \"text:greeting\": { \"$text\": \"'Hello, ' + g.name\" } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-event-handler",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"event_handler\", g: { count: 0 }, layout: { \"button:add\": { label: \"Add\", onclick: \"g.count = g.count + Number($event || 1)\" } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-loop-condition",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"loop_condition\", g: { visible: true, items: [{ id: \"a\", label: \"A\" }] }, layout: { \"column:list\": { \"$if\": \"g.visible\", \"text:item\": { \"$for\": \"g.items\", \"$key\": \"$item.id\", \"$text\": \"$item.label\" } } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-stdlib",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"stdlib\", g: { done: 3, total: 4 }, layout: { \"stat:progress\": { label: \"Progress\", \"$value\": \"std.format.percent(std.math.safeDivide(g.done, g.total), 1)\" } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-secure-api",
      "kind": "valid",
      "mode": "secure",
      "source": "{ slex: \"0.1\", namespace: \"secure_api\", g: { status: \"idle\", async load() { const result = await api.fetch(\"/status\"); this.status = String(result.status); } }, layout: { \"button:load\": { label: \"Load\", onclick: \"g.load()\" }, \"text:status\": { \"$text\": \"g.status\" } } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-bare-tree",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ \"text:message\": { text: \"Bare tree\" } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "valid-state-only",
      "kind": "valid",
      "mode": "trusted",
      "source": "{ slex: \"0.1\", namespace: \"state_only\", g: { ready: true } }",
      "expected": {
        "ok": true,
        "warnings": []
      }
    },
    {
      "id": "warning-secure-native-capability",
      "kind": "warning",
      "mode": "secure",
      "source": "{ slex: \"0.1\", namespace: \"native_fetch\", g: { load() { fetch(\"/x\"); } }, layout: { \"button:load\": { label: \"Load\", onclick: \"g.load()\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "native_secure_capability",
            "path": "g.load",
            "value": "fetch"
          }
        ]
      }
    },
    {
      "id": "warning-secure-native-timer-websocket",
      "kind": "warning",
      "mode": "secure",
      "source": "{ slex: \"0.1\", namespace: \"native_timer_socket\", g: { start() { setTimeout(() => {}, 10); const socket = new WebSocket(\"wss://example.com\"); return socket; } }, layout: { \"button:start\": { label: \"Start\", onclick: \"g.start()\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "native_secure_capability",
            "path": "g.start",
            "value": "WebSocket"
          },
          {
            "code": "native_secure_capability",
            "path": "g.start",
            "value": "setTimeout"
          }
        ]
      }
    },
    {
      "id": "warning-unknown-component-prop",
      "kind": "warning",
      "mode": "trusted",
      "source": "{ namespace: \"unknowns\", layout: { \"madeup:thing\": { madeUp: true }, \"text:body\": { madeUp: true } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "unknown_component",
            "path": "layout.madeup:thing",
            "value": "madeup"
          },
          {
            "code": "unknown_prop",
            "path": "layout.text:body.madeUp",
            "value": "madeUp"
          }
        ]
      }
    },
    {
      "id": "warning-invalid-component-key",
      "kind": "warning",
      "mode": "trusted",
      "source": "{ namespace: \"bad_key\", layout: { \"Text Bad:item\": { text: \"bad\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "invalid_component_key",
            "path": "layout.Text Bad:item",
            "value": "Text Bad:item"
          }
        ]
      }
    },
    {
      "id": "warning-invalid-directive-type",
      "kind": "warning",
      "mode": "trusted",
      "source": "{ namespace: \"bad_directive\", layout: { \"text:message\": { \"$if\": true, text: \"bad\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "invalid_directive_type",
            "path": "layout.text:message.$if",
            "value": "$if"
          }
        ]
      }
    },
    {
      "id": "warning-unsupported-protocol",
      "kind": "warning",
      "mode": "trusted",
      "source": "{ slex: \"9.9\", namespace: \"future\", layout: { \"text:message\": { text: \"future\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "unsupported_protocol",
            "path": "slex",
            "value": "9.9"
          }
        ]
      }
    },
    {
      "id": "warning-reserved-context-shadowing",
      "kind": "warning",
      "mode": "trusted",
      "source": "{ namespace: \"shadow\", g: { std: \"bad\" }, layout: { \"text:api\": { text: \"shadow\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "reserved_context_shadowing",
            "path": "g.std",
            "value": "std"
          },
          {
            "code": "reserved_context_shadowing",
            "path": "layout.text:api",
            "value": "api"
          }
        ]
      }
    },
    {
      "id": "warning-unknown-std-api",
      "kind": "warning",
      "mode": "secure",
      "source": "{ slex: \"0.1\", namespace: \"unknown_logic\", g: { load() { api.socket(); } }, layout: { \"text:value\": { \"$text\": \"std.math.nope(1)\" } } }",
      "expected": {
        "ok": true,
        "warnings": [
          {
            "code": "unknown_api_member",
            "path": "g.load",
            "value": "api.socket"
          },
          {
            "code": "unknown_std_member",
            "path": "layout.text:value.$text",
            "value": "std.math.nope"
          }
        ]
      }
    },
    {
      "id": "invalid-syntax",
      "kind": "invalid",
      "mode": "trusted",
      "source": "{ namespace: \"broken\", layout: { \"text:message\": { text: \"missing close\" }",
      "expected": {
        "ok": false,
        "diagnostic": "syntax"
      }
    }
  ]
}
