[
  {
    "name": "List returns array envelope",
    "request": "{\"action\":\"fragments.list\"}",
    "expectOk": true,
    "dataKind": "array"
  },
  {
    "name": "Create returns object envelope",
    "request": "{\"action\":\"fragments.create\",\"payload\":{\"type\":\"!NOTE\",\"description\":\"fixture create\"}}",
    "expectOk": true,
    "dataKind": "object"
  },
  {
    "name": "Get missing id returns null data",
    "request": "{\"action\":\"fragments.get\",\"id\":\"00000000-0000-0000-0000-000000000001\"}",
    "expectOk": true,
    "dataKind": "null"
  },
  {
    "name": "Create missing payload fails",
    "request": "{\"action\":\"fragments.create\"}",
    "expectOk": false,
    "errorContains": "payload"
  },
  {
    "name": "AI health returns object envelope",
    "request": "{\"action\":\"ai.health\"}",
    "expectOk": true,
    "dataKind": "object"
  },
  {
    "name": "AI summarize entry returns string envelope",
    "request": "{\"action\":\"ai.summarize_entry\",\"payload\":{\"content\":\"transport test\"}}",
    "expectOk": true,
    "dataKind": "string"
  },
  {
    "name": "Unknown action fails",
    "request": "{\"action\":\"unknown.action\"}",
    "expectOk": false,
    "errorContains": "Unknown action"
  },
  {
    "name": "Malformed JSON fails",
    "request": "{\"action\":\"fragments.list\"",
    "expectOk": false,
    "errorContains": "Invalid command JSON"
  }
]
