mvp.v1.json (11515B)
1 { 2 "suite": "social_mvp", 3 "contract_version": "0.1.0", 4 "vectors": [ 5 { 6 "id": "social_post_tags_with_metadata_valid_001", 7 "kind": "social.post.build_tags.valid", 8 "input": { 9 "post": { 10 "content": "field update", 11 "farm": { 12 "farm": { 13 "pubkey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 14 "d_tag": "AAAAAAAAAAAAAAAAAAAAAA" 15 }, 16 "relays": [ 17 "wss://relay.example.test" 18 ] 19 }, 20 "topics": [ 21 "soil" 22 ], 23 "media": [ 24 { 25 "url": "https://media.example.test/field.jpg", 26 "mime_type": "image/jpeg", 27 "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 28 } 29 ] 30 } 31 }, 32 "expected": { 33 "result": "ok", 34 "required_tags": [ 35 "a", 36 "t", 37 "imeta" 38 ] 39 } 40 }, 41 { 42 "id": "social_post_tags_empty_content_valid_002", 43 "kind": "social.post.build_tags.valid", 44 "input": { 45 "post": { 46 "content": "" 47 } 48 }, 49 "expected": { 50 "result": "ok", 51 "required_tags": [] 52 } 53 }, 54 { 55 "id": "social_post_tags_malformed_imeta_invalid_003", 56 "kind": "social.post.build_tags.invalid", 57 "input": { 58 "post": { 59 "content": "field update", 60 "media": [ 61 { 62 "imeta": [ 63 [ 64 "url https://media.example.test/field.jpg", 65 "" 66 ] 67 ] 68 } 69 ] 70 } 71 }, 72 "expected": { 73 "result": "error", 74 "error_class": "encode_error", 75 "field": "imeta" 76 } 77 }, 78 { 79 "id": "social_comment_event_root_address_parent_valid_004", 80 "kind": "social.comment.build_tags.valid", 81 "input": { 82 "comment": { 83 "root": { 84 "kind": "event", 85 "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 86 "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 87 "event_kind": 30023, 88 "relays": [ 89 "wss://relay.example.test" 90 ] 91 }, 92 "parent": { 93 "kind": "address", 94 "address": "30023:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:AAAAAAAAAAAAAAAAAAAAAg", 95 "author": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 96 "event_kind": 30023, 97 "relays": [ 98 "wss://relay2.example.test" 99 ] 100 }, 101 "content": "great notes" 102 } 103 }, 104 "expected": { 105 "result": "ok", 106 "required_tags": [ 107 "E", 108 "P", 109 "K", 110 "a", 111 "p", 112 "k" 113 ] 114 } 115 }, 116 { 117 "id": "social_comment_external_root_parent_valid_005", 118 "kind": "social.comment.build_tags.valid", 119 "input": { 120 "comment": { 121 "root": { 122 "kind": "external", 123 "id": "https://example.test/root", 124 "external_kind": "web", 125 "hint": "https://example.test/root" 126 }, 127 "parent": { 128 "kind": "external", 129 "id": "https://example.test/parent", 130 "external_kind": "web", 131 "hint": "https://example.test/parent" 132 }, 133 "content": "linked context" 134 } 135 }, 136 "expected": { 137 "result": "ok", 138 "required_tags": [ 139 "I", 140 "K", 141 "i", 142 "k" 143 ] 144 } 145 }, 146 { 147 "id": "social_comment_kind_one_target_invalid_006", 148 "kind": "social.comment.build_tags.invalid", 149 "input": { 150 "comment": { 151 "root": { 152 "kind": "event", 153 "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 154 "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 155 "event_kind": 1, 156 "relays": [] 157 }, 158 "parent": { 159 "kind": "event", 160 "id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 161 "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 162 "event_kind": 1, 163 "relays": [] 164 }, 165 "content": "reply" 166 } 167 }, 168 "expected": { 169 "result": "error", 170 "error_class": "encode_error", 171 "field": "root" 172 } 173 }, 174 { 175 "id": "social_comment_legacy_decode_invalid_007", 176 "kind": "social.comment.parse_event.invalid", 177 "input": { 178 "event": { 179 "kind": 1111, 180 "content": "legacy", 181 "tags": [ 182 [ 183 "e_root", 184 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 185 ], 186 [ 187 "e_prev", 188 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" 189 ] 190 ] 191 } 192 }, 193 "expected": { 194 "result": "error", 195 "error_class": "parse_error", 196 "rejected_tags": [ 197 "e_root", 198 "e_prev" 199 ] 200 } 201 }, 202 { 203 "id": "social_reaction_empty_content_valid_008", 204 "kind": "social.reaction.build_tags.valid", 205 "input": { 206 "reaction": { 207 "target": { 208 "kind": "address", 209 "address": "30023:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:AAAAAAAAAAAAAAAAAAAAAg", 210 "author": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 211 "event_kind": 30023, 212 "relays": [ 213 "wss://relay.example.test" 214 ] 215 }, 216 "content": "" 217 } 218 }, 219 "expected": { 220 "result": "ok", 221 "required_tags": [ 222 "a", 223 "p", 224 "k" 225 ] 226 } 227 }, 228 { 229 "id": "social_reaction_missing_target_invalid_009", 230 "kind": "social.reaction.parse_event.invalid", 231 "input": { 232 "event": { 233 "kind": 7, 234 "content": "+", 235 "tags": [] 236 } 237 }, 238 "expected": { 239 "result": "error", 240 "error_class": "parse_error", 241 "missing_target": true 242 } 243 }, 244 { 245 "id": "social_article_tags_valid_010", 246 "kind": "social.article.build_tags.valid", 247 "input": { 248 "article": { 249 "d_tag": "AAAAAAAAAAAAAAAAAAAAAg", 250 "title": "soil notes", 251 "content": "# soil notes", 252 "summary": "cover crop observations", 253 "published_at": 1780000000, 254 "topics": [ 255 "soil", 256 "cover-crops" 257 ] 258 } 259 }, 260 "expected": { 261 "result": "ok", 262 "required_tags": [ 263 "d", 264 "title", 265 "summary", 266 "published_at", 267 "t" 268 ] 269 } 270 }, 271 { 272 "id": "social_article_missing_title_invalid_011", 273 "kind": "social.article.build_tags.invalid", 274 "input": { 275 "article": { 276 "d_tag": "AAAAAAAAAAAAAAAAAAAAAg", 277 "title": "", 278 "content": "# soil notes" 279 } 280 }, 281 "expected": { 282 "result": "error", 283 "error_class": "encode_error", 284 "field": "title" 285 } 286 }, 287 { 288 "id": "social_file_metadata_public_valid_012", 289 "kind": "social.file_metadata.build_tags.valid", 290 "input": { 291 "metadata": { 292 "url": "https://media.example.test/public.jpg", 293 "mime_type": "image/jpeg", 294 "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", 295 "magnet": "magnet:?xt=urn:btih:abc", 296 "content_hashes": [ 297 "sha256:field" 298 ], 299 "services": [ 300 "https://media.example.test" 301 ] 302 } 303 }, 304 "expected": { 305 "result": "ok", 306 "required_tags": [ 307 "url", 308 "m", 309 "x", 310 "magnet", 311 "i", 312 "service" 313 ] 314 } 315 }, 316 { 317 "id": "social_file_metadata_bad_hash_invalid_013", 318 "kind": "social.file_metadata.build_tags.invalid", 319 "input": { 320 "metadata": { 321 "url": "https://media.example.test/public.jpg", 322 "mime_type": "image/jpeg", 323 "sha256": "not-a-sha" 324 } 325 }, 326 "expected": { 327 "result": "error", 328 "error_class": "encode_error", 329 "field": "sha256" 330 } 331 }, 332 { 333 "id": "social_calendar_date_tags_valid_014", 334 "kind": "social.calendar_date_event.build_tags.valid", 335 "input": { 336 "event": { 337 "d_tag": "AAAAAAAAAAAAAAAAAAAAAw", 338 "title": "market day", 339 "start": "2026-06-20", 340 "description": "Farm stand pickup window.", 341 "end": "2026-06-21", 342 "days": [ 343 { 344 "value": "2026-06-20" 345 } 346 ] 347 } 348 }, 349 "expected": { 350 "result": "ok", 351 "required_tags": [ 352 "d", 353 "title", 354 "start", 355 "end", 356 "D" 357 ], 358 "content": "Farm stand pickup window." 359 } 360 }, 361 { 362 "id": "social_calendar_date_bad_date_invalid_015", 363 "kind": "social.calendar_date_event.build_tags.invalid", 364 "input": { 365 "event": { 366 "d_tag": "AAAAAAAAAAAAAAAAAAAAAw", 367 "title": "market day", 368 "start": "June 20" 369 } 370 }, 371 "expected": { 372 "result": "error", 373 "error_class": "encode_error", 374 "field": "start" 375 } 376 }, 377 { 378 "id": "social_calendar_time_tags_valid_016", 379 "kind": "social.calendar_time_event.build_tags.valid", 380 "input": { 381 "event": { 382 "d_tag": "AAAAAAAAAAAAAAAAAAAA-A", 383 "title": "wash pack shift", 384 "start": 1781895600, 385 "dates": [ 386 { 387 "value": "2026-06-20" 388 } 389 ], 390 "description": "Prepare CSA bins before pickup.", 391 "end": 1781899200, 392 "start_tzid": "America/Vancouver" 393 } 394 }, 395 "expected": { 396 "result": "ok", 397 "required_tags": [ 398 "d", 399 "title", 400 "start", 401 "D", 402 "end", 403 "start_tzid" 404 ], 405 "content": "Prepare CSA bins before pickup." 406 } 407 }, 408 { 409 "id": "social_calendar_time_end_before_start_invalid_017", 410 "kind": "social.calendar_time_event.build_tags.invalid", 411 "input": { 412 "event": { 413 "d_tag": "AAAAAAAAAAAAAAAAAAAA-A", 414 "title": "wash pack shift", 415 "start": 1781899200, 416 "dates": [ 417 { 418 "value": "2026-06-20" 419 } 420 ], 421 "end": 1781895600 422 } 423 }, 424 "expected": { 425 "result": "error", 426 "error_class": "encode_error", 427 "field": "end" 428 } 429 }, 430 { 431 "id": "social_calendar_time_missing_date_invalid_018", 432 "kind": "social.calendar_time_event.build_tags.invalid", 433 "input": { 434 "event": { 435 "d_tag": "AAAAAAAAAAAAAAAAAAAA-A", 436 "title": "wash pack shift", 437 "start": 1781895600 438 } 439 }, 440 "expected": { 441 "result": "error", 442 "error_class": "encode_error", 443 "field": "dates" 444 } 445 } 446 ] 447 }