{
  "revision": "0.20",
  "description": "Нормативные структурные примеры и граничные значения. Нулевой hash в объекте конфигурации обозначает внешний манифест, а не хеш вложенного звукового файла.",
  "config": {
    "schemaVersion": "open-alert-config/5",
    "configId": "00000000000000000000000000000001",
    "revision": "1",
    "authorId": "00000000000000000000000000000002",
    "targets": [
      {
        "id": "00000000000000000000000000000003",
        "ownerNodeId": "00000000000000000000000000000002",
        "deviceId": "00000000000000000000000000000004",
        "resourceId": "out1",
        "bindingGeneration": "1",
        "networkScope": "site",
        "address": "192.0.2.1",
        "port": "443"
      }
    ],
    "groups": [
      {
        "id": "all",
        "revision": "1",
        "members": [
          "00000000000000000000000000000003"
        ]
      }
    ],
    "programs": [
      {
        "id": "alarm",
        "revision": "1",
        "stages": [
          {
            "index": "1",
            "kind": "siren",
            "repeat": "1",
            "gapMs": "0",
            "siren": {
              "pattern": "continuous",
              "durationMs": "3000",
              "signalProfileId": "siren1",
              "signalProfileRevision": "1"
            }
          },
          {
            "index": "2",
            "kind": "recording",
            "repeat": "1",
            "gapMs": "0",
            "recording": {
              "contentId": "speech",
              "revision": "1",
              "hashAlgorithm": "streebog256",
              "hash": "0000000000000000000000000000000000000000000000000000000000000000"
            }
          }
        ]
      }
    ],
    "content": [
      {
        "id": "speech",
        "revision": "1",
        "codec": "PCMA",
        "bytes": "160",
        "sampleCount": "160",
        "hashAlgorithm": "streebog256",
        "hash": "0000000000000000000000000000000000000000000000000000000000000000",
        "placements": [
          {
            "targetId": "00000000000000000000000000000003",
            "location": "controller"
          }
        ]
      }
    ],
    "profiles": [
      {
        "id": "siren1",
        "revision": "1",
        "kind": "siren",
        "targetIds": [
          "00000000000000000000000000000003"
        ],
        "parameters": [
          {
            "name": "continuousSupported",
            "type": "bool",
            "value": "true"
          },
          {
            "name": "durationMaxMs",
            "type": "counter",
            "value": "3600000"
          },
          {
            "name": "durationMinMs",
            "type": "counter",
            "value": "100"
          },
          {
            "name": "durationStepMs",
            "type": "counter",
            "value": "100"
          },
          {
            "name": "evidenceMaxAgeMs",
            "type": "counter",
            "value": "100"
          },
          {
            "name": "intermittentSupported",
            "type": "bool",
            "value": "false"
          },
          {
            "name": "offEvidence",
            "type": "enum",
            "value": "electrical"
          },
          {
            "name": "offPointId",
            "type": "string",
            "value": "outputOff"
          },
          {
            "name": "prepareTimeoutMs",
            "type": "counter",
            "value": "1000"
          },
          {
            "name": "recoveryStopAttempts",
            "type": "counter",
            "value": "0"
          },
          {
            "name": "recoveryTimeoutMs",
            "type": "counter",
            "value": "1000"
          },
          {
            "name": "runningEvidence",
            "type": "enum",
            "value": "electrical"
          },
          {
            "name": "runningPointId",
            "type": "string",
            "value": "outputOn"
          },
          {
            "name": "signalKind",
            "type": "enum",
            "value": "tone"
          },
          {
            "name": "signalMaxHz",
            "type": "counter",
            "value": "1000"
          },
          {
            "name": "signalMinHz",
            "type": "counter",
            "value": "1000"
          },
          {
            "name": "signalPeriodMs",
            "type": "counter",
            "value": "0"
          },
          {
            "name": "signalSpecId",
            "type": "string",
            "value": "tone1"
          },
          {
            "name": "signalSpecRevision",
            "type": "counter",
            "value": "1"
          },
          {
            "name": "signalToleranceHz",
            "type": "counter",
            "value": "10"
          },
          {
            "name": "signalWaveform",
            "type": "enum",
            "value": "sine"
          },
          {
            "name": "stableSamples",
            "type": "counter",
            "value": "2"
          },
          {
            "name": "stopBeginMs",
            "type": "counter",
            "value": "100"
          },
          {
            "name": "stopConfirmMs",
            "type": "counter",
            "value": "3000"
          }
        ]
      }
    ],
    "controllers": [
      {
        "id": "00000000000000000000000000000004",
        "onControlLoss": "finish"
      }
    ],
    "localRules": [
      {
        "id": "fire-input",
        "revision": "1",
        "deviceId": "00000000000000000000000000000004",
        "inputId": "fire1",
        "trigger": "level",
        "activeValue": "true",
        "debounceMs": "50",
        "rearmMs": "100",
        "programId": "alarm",
        "programRevision": "1",
        "purpose": "real",
        "maxDurationMs": "30000",
        "targetIds": [
          "00000000000000000000000000000003"
        ]
      }
    ],
    "signalSpecs": [
      {
        "id": "tone1",
        "revision": "1",
        "kind": "tone",
        "waveform": "sine",
        "minHz": "1000",
        "maxHz": "1000",
        "toleranceHz": "10",
        "periodMs": "0"
      }
    ],
    "mediaGroups": []
  },
  "nodeFrames": [
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "node.hello",
      "body": {
        "nodeId": "00000000000000000000000000000002",
        "profile": "node-alert/2"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "run.start",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "deadlineUtcMs": "100000",
        "clockErrorMs": "10",
        "hopLimit": "4",
        "path": [
          "00000000000000000000000000000002"
        ],
        "purpose": "real",
        "planId": "alarm",
        "planRevision": "1",
        "maxDurationMs": "10000",
        "targetDigest": "96e99b9fd8f8f53786fa36ec356aac78d84e3ba971a6daa528e365a48d05863b",
        "targets": [
          {
            "targetId": "00000000000000000000000000000003",
            "bindingGeneration": "1"
          }
        ]
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "run.cancel",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "deadlineUtcMs": "100000",
        "clockErrorMs": "10",
        "hopLimit": "4",
        "path": [
          "00000000000000000000000000000002"
        ]
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "run.get",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "result.read",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "targetId": "00000000000000000000000000000003"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "catalog.get",
      "body": {}
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "id": "00000000000000000000000000000007",
      "action": "observations.get",
      "body": {
        "targetId": "00000000000000000000000000000003",
        "pointIds": [
          "power"
        ],
        "deadlineUtcMs": "100000",
        "clockErrorMs": "10",
        "hopLimit": "4",
        "path": [
          "00000000000000000000000000000002"
        ]
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "ok",
      "kind": "hello",
      "body": {
        "nodeId": "00000000000000000000000000000008",
        "selectedProfile": "node-alert/2",
        "maxBytes": "65536"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "accepted",
      "kind": "admission",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "state": "accepted",
        "targetCount": "1"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "ok",
      "kind": "runResult",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "snapshotId": "00000000000000000000000000000009",
        "evaluatedAtUtcMs": "90000",
        "more": false,
        "targetCount": "1",
        "state": "pending",
        "targets": [
          {
            "targetId": "00000000000000000000000000000003",
            "admission": "pending",
            "state": "pending",
            "result": "none",
            "reason": "none",
            "sourceNodeId": "00000000000000000000000000000008",
            "deviceId": "00000000000000000000000000000004",
            "execution": "pending",
            "completion": "pending"
          }
        ]
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "ok",
      "kind": "catalog",
      "body": {
        "snapshotId": "00000000000000000000000000000009",
        "more": false,
        "revision": "1",
        "targetCount": "0",
        "groupCount": "0",
        "programCount": "0",
        "targets": [],
        "groups": [],
        "programs": []
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "ok",
      "kind": "observations",
      "body": {
        "targetId": "00000000000000000000000000000003",
        "sourceNodeId": "00000000000000000000000000000008",
        "bootId": "0000000000000000000000000000000a",
        "capabilityRevision": "1",
        "bindingGeneration": "1",
        "points": [
          {
            "id": "power",
            "type": "bool",
            "validity": "unavailable",
            "freshness": "never",
            "reason": "sourceUnavailable",
            "sourceId": "driver",
            "observedAtMs": "0",
            "evaluatedAtMs": "90000",
            "maxAgeMs": "1000"
          }
        ]
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "error",
      "kind": "error",
      "body": {
        "code": "startBlockedByCancel"
      }
    },
    {
      "v": "1",
      "profile": "node-alert/2",
      "to": "00000000000000000000000000000007",
      "status": "ok",
      "kind": "rawResult",
      "body": {
        "originNodeId": "00000000000000000000000000000002",
        "originSeq": "1",
        "runId": "00000000000000000000000000000005",
        "branchId": "00000000000000000000000000000006",
        "targetId": "00000000000000000000000000000003",
        "sourceNodeId": "00000000000000000000000000000008",
        "snapshotId": "00000000000000000000000000000009",
        "more": true,
        "cursor": "page2",
        "requestXml": "<request v=\"1\" profile=\"open-alert-draft/0.20\" id=\"00000000000000000000000000003007\" action=\"session.get\" bootId=\"00000000000000000000000000000073\" controlEpoch=\"00000000000000000000000000000091\"><selection startSeq=\"1\"/></request>",
        "responseXml": "<response v=\"1\" profile=\"open-alert-draft/0.20\" to=\"00000000000000000000000000003007\" bootId=\"00000000000000000000000000000073\" status=\"ok\"><result snapshotId=\"00000000000000000000000000000094\" stateRevision=\"40\" more=\"true\" cursor=\"page2\" resourceCount=\"1\" checkCount=\"1\" observationCount=\"0\" mode=\"siren\" evaluatedAtMs=\"72000\" executionCount=\"1\" faultCount=\"0\"><session id=\"00000000000000000000000000000581\" startSeq=\"1\" state=\"finished\" onControlLoss=\"stop\" configRevision=\"7\" capabilityRevision=\"4\" acceptedAtMs=\"50000\" maxDurationMs=\"30000\" result=\"succeeded\" reason=\"completed\"/><resource id=\"ou1\" output=\"off\" evidence=\"reportedMode\" observedAtMs=\"71000\" bindingGeneration=\"2\"/></result></response>"
      }
    }
  ],
  "transfers": [
    {
      "bytes": 1048576,
      "blockBytes": 4096,
      "windowBlocks": 4,
      "windowRoundTripMaxMs": 100,
      "blocks": 256,
      "windows": 64,
      "budgetMs": 606400
    },
    {
      "bytes": 33554432,
      "blockBytes": 4096,
      "windowBlocks": 4,
      "windowRoundTripMaxMs": 100,
      "blocks": 8192,
      "windows": 2048,
      "budgetMs": 804800
    },
    {
      "bytes": 33554432,
      "blockBytes": 4096,
      "windowBlocks": 4,
      "windowRoundTripMaxMs": 600,
      "blocks": 8192,
      "windows": 2048,
      "budgetMs": 1828800
    },
    {
      "bytes": 33554432,
      "blockBytes": 65536,
      "windowBlocks": 64,
      "windowRoundTripMaxMs": 100,
      "blocks": 512,
      "windows": 8,
      "budgetMs": 600800
    }
  ],
  "rtp": {
    "firstSeq": 100,
    "firstTimestamp": 1000,
    "ssrc": 1,
    "codec": "PCMA",
    "packetMs": 20,
    "packets": [
      {
        "name": "full",
        "hex": "90880064000003e800000001534f00040000000000a00000000000000000c350d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5",
        "index": 0,
        "validSamples": 160,
        "end": false,
        "capturedAtMs": 50000
      },
      {
        "name": "tail",
        "hex": "900800650000048800000001534f00040000000100280001000000000000c364d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5",
        "index": 1,
        "validSamples": 40,
        "end": true,
        "sampleCount": 200,
        "capturedAtMs": 50020
      },
      {
        "name": "boundary",
        "hex": "900800650000048800000001534f00040000000100000001000000000000c364",
        "index": 1,
        "validSamples": 0,
        "end": true,
        "sampleCount": 160,
        "capturedAtMs": 50020
      },
      {
        "name": "empty",
        "hex": "90880064000003e800000001534f00040000000000000001000000000000c350",
        "index": 0,
        "validSamples": 0,
        "end": true,
        "sampleCount": 0,
        "capturedAtMs": 50000
      }
    ],
    "profile": "rtp-alert/4"
  },
  "traces": [
    {
      "id": "late-eof",
      "input": "PCMA: полный пакет index=0, END index=1 с validSamples=40; audio.finish приходит через 200 мс после END.",
      "expected": "sourceSamples=200, concealedSamples=0; 120 отсчетов дополнения не выдаются как звук источника; поздний finish подтверждает границу 200."
    },
    {
      "id": "full-boundary",
      "input": "Микрофон отправил полный пакет index=0 без END, затем остановился.",
      "expected": "END index=1, validSamples=0, нагрузка 0; sourceSamples=160, второго звукового пакета нет."
    },
    {
      "id": "short-stream",
      "input": "END index=0, validSamples=40 приходит до накопления initialMs=60.",
      "expected": "Начать выдачу после получения полного короткого потока, потребить 40 отсчетов источника; не ждать 60 мс."
    },
    {
      "id": "missing-final",
      "input": "Микрофон уже running: полные пакеты index=0..2; END index=3 с validSamples=40 утрачен; получен надежный EOF sampleCount=520.",
      "expected": "40 отсчетов замены; failed/mediaIncomplete, успех запрещен."
    },
    {
      "id": "service-handover",
      "input": "Свободная эпоха maintenance, идет загрузка; разрешенный acquire real получен при t=0.",
      "expected": "Шаг обслуживания завершен до 100 мс, решение и ответ новой выдачи до 500 мс; старая эпоха не фиксирует очереди; подтвержденные байты сохранены."
    },
    {
      "id": "idle-heartbeat",
      "input": "Свободная эпоха real выдана при t=0; heartbeat каждую 1000 мс, START отсутствует.",
      "expected": "Освобождение не позднее t=10000 мс; heartbeat не продлевает idleDeadlineMs."
    },
    {
      "id": "active-owner",
      "input": "Действующее или неопределенное чужое исполнение и acquire real другого участника.",
      "expected": "busy; действующее чужое исполнение не прерывается."
    },
    {
      "id": "clock-drift",
      "input": "Потерь нет, джиттер доставки до 20 мс; дрейф +200 ppm в течение 600 с, затем отдельные трассы -200 ppm и изменения 1 ppm/с.",
      "expected": "Нет удаления/повтора пакетов, underrun и переполнения; sourceSamples отделен от счетчика ЦАП; среднее заполнение за 1 с после 10 с находится в initialMs ± один пакет."
    },
    {
      "id": "unbound-media",
      "input": "Действующий поток; media.hello другого principalId с верным mediaId.",
      "expected": "Закрыто только входящее соединение; действующий поток, буфер и результат не изменены."
    },
    {
      "id": "exercise-admission",
      "input": "Свободный УУ; purpose=exercise, maxDurationMs=30001.",
      "expected": "invalidArgument до воздействия; учебный сеанс не создан."
    },
    {
      "id": "level-at-boot",
      "input": "После reboot и подтвержденного off вход level остается активным; новое valid/fresh наблюдение и debounceMs выполнены.",
      "expected": "Новый локальный сеанс по текущему условию; прежний сетевой START не повторяется. Для edge при том же уровне запуска нет."
    },
    {
      "id": "level-busy-cleared",
      "input": "Вход level активен при занятом ресурсе, затем неактивен rearmMs до освобождения.",
      "expected": "Ожидание снято; после освобождения отложенного запуска нет."
    }
  ]
}
