@superjackfruitlabs/treaty-matrix-events 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/gate.js CHANGED
@@ -271,7 +271,7 @@ const RawSubject = z.object({
271
271
  id: z.string().min(1).max(SUBJECT_KEY_MAX),
272
272
  digest: z.string().min(1).max(SUBJECT_KEY_MAX),
273
273
  schema: z.string().min(1).max(PREVIEW_FIELD_MAX),
274
- revision: z.number().finite(),
274
+ revision: z.number().int().nonnegative(),
275
275
  expiresAt: z.string().max(PREVIEW_FIELD_MAX).nullish().catch(null),
276
276
  preview: z.array(z.unknown()).optional().catch(undefined),
277
277
  /** False when the board had to cut or drop blocks to fit the bounds. Absent from older boards. */
@@ -37,7 +37,10 @@ export interface PermissionOptionV2 {
37
37
  meaning: GateOptionMeaning;
38
38
  scope?: OptionScope;
39
39
  }
40
- /** The options a harness offered, in its order, with meanings; one with no usable id is dropped. */
40
+ /**
41
+ * The options a harness offered, in its order, with meanings; one with no usable id is dropped,
42
+ * and none past the twentieth is carried.
43
+ */
41
44
  export declare function permissionOptionsV2(rawOptions: unknown): PermissionOptionV2[];
42
45
  /** Everything permission.v2 needs from a request, and the binding recorded for it. */
43
46
  export interface HarnessPermission {
@@ -41,7 +41,12 @@ const AcpOption = z.object({
41
41
  name: z.string(),
42
42
  kind: z.string().optional(),
43
43
  });
44
- /** The options a harness offered, in its order, with meanings; one with no usable id is dropped. */
44
+ /** As many options as a gate.v2 carries; the prose message still lists every one. */
45
+ const OPTIONS_MAX = 20;
46
+ /**
47
+ * The options a harness offered, in its order, with meanings; one with no usable id is dropped,
48
+ * and none past the twentieth is carried.
49
+ */
45
50
  export function permissionOptionsV2(rawOptions) {
46
51
  if (!Array.isArray(rawOptions))
47
52
  return [];
@@ -60,6 +65,8 @@ export function permissionOptionsV2(rawOptions) {
60
65
  meaning: mapped.meaning,
61
66
  ...(mapped.scope ? { scope: mapped.scope } : {}),
62
67
  });
68
+ if (out.length === OPTIONS_MAX)
69
+ break;
63
70
  }
64
71
  return out;
65
72
  }
package/examples.json CHANGED
@@ -1417,6 +1417,368 @@
1417
1417
  ]
1418
1418
  }
1419
1419
  }
1420
+ },
1421
+ {
1422
+ "why": "a subject revision that is not a whole number",
1423
+ "refusedBy": "schema",
1424
+ "body": {
1425
+ "msgtype": "m.text",
1426
+ "body": "Permission needed: Run the test suite\n\n1. Allow once\n2. Always allow\n3. Reject\n4. Never allow\n\nReply with the number, or the option's name.",
1427
+ "suite_event_type": "dev.agentpod.permission.v2",
1428
+ "schema_version": 1,
1429
+ "request_id": "acps_3f0c:12",
1430
+ "session_id": "acps_3f0c",
1431
+ "request_seq": 12,
1432
+ "title": "Run the test suite",
1433
+ "tool_kind": "execute",
1434
+ "options": [
1435
+ {
1436
+ "id": "allow_once",
1437
+ "label": "Allow once",
1438
+ "meaning": "approve",
1439
+ "scope": "once"
1440
+ },
1441
+ {
1442
+ "id": "allow_always",
1443
+ "label": "Always allow",
1444
+ "meaning": "approve",
1445
+ "scope": "always"
1446
+ },
1447
+ {
1448
+ "id": "reject_once",
1449
+ "label": "Reject",
1450
+ "meaning": "reject",
1451
+ "scope": "once"
1452
+ },
1453
+ {
1454
+ "id": "reject_always",
1455
+ "label": "Never allow",
1456
+ "meaning": "reject",
1457
+ "scope": "always"
1458
+ }
1459
+ ],
1460
+ "subject": {
1461
+ "id": "acps_3f0c:12",
1462
+ "digest": "bb03bfd8ee6d757e6957d029cd6a7b8e004f16386755ce672e3f97f445563878",
1463
+ "schema": "harness-permission/v1",
1464
+ "revision": 1.5,
1465
+ "expires_at": "2026-11-07T10:30:00.000Z",
1466
+ "preview": [
1467
+ {
1468
+ "type": "field",
1469
+ "label": "Tool",
1470
+ "value": "Run the test suite"
1471
+ },
1472
+ {
1473
+ "type": "field",
1474
+ "label": "Kind",
1475
+ "value": "execute"
1476
+ },
1477
+ {
1478
+ "type": "text",
1479
+ "label": "Command",
1480
+ "text": "bun test"
1481
+ },
1482
+ {
1483
+ "type": "field",
1484
+ "label": "Location",
1485
+ "value": "apps/hub"
1486
+ }
1487
+ ],
1488
+ "preview_complete": true
1489
+ },
1490
+ "dev.agentpod.permission": {
1491
+ "schema_version": 1,
1492
+ "session_id": "acps_3f0c",
1493
+ "request_seq": 12,
1494
+ "title": "Run the test suite",
1495
+ "options": [
1496
+ {
1497
+ "option_id": "allow_once",
1498
+ "name": "Allow once"
1499
+ },
1500
+ {
1501
+ "option_id": "allow_always",
1502
+ "name": "Always allow"
1503
+ },
1504
+ {
1505
+ "option_id": "reject_once",
1506
+ "name": "Reject"
1507
+ },
1508
+ {
1509
+ "option_id": "reject_always",
1510
+ "name": "Never allow"
1511
+ }
1512
+ ]
1513
+ }
1514
+ }
1515
+ },
1516
+ {
1517
+ "why": "no options: nothing to answer with",
1518
+ "refusedBy": "schema",
1519
+ "body": {
1520
+ "msgtype": "m.text",
1521
+ "body": "Permission needed: Run the test suite\n\n1. Allow once\n2. Always allow\n3. Reject\n4. Never allow\n\nReply with the number, or the option's name.",
1522
+ "suite_event_type": "dev.agentpod.permission.v2",
1523
+ "schema_version": 1,
1524
+ "request_id": "acps_3f0c:12",
1525
+ "session_id": "acps_3f0c",
1526
+ "request_seq": 12,
1527
+ "title": "Run the test suite",
1528
+ "tool_kind": "execute",
1529
+ "options": [],
1530
+ "subject": {
1531
+ "id": "acps_3f0c:12",
1532
+ "digest": "bb03bfd8ee6d757e6957d029cd6a7b8e004f16386755ce672e3f97f445563878",
1533
+ "schema": "harness-permission/v1",
1534
+ "revision": 1,
1535
+ "expires_at": "2026-11-07T10:30:00.000Z",
1536
+ "preview": [
1537
+ {
1538
+ "type": "field",
1539
+ "label": "Tool",
1540
+ "value": "Run the test suite"
1541
+ },
1542
+ {
1543
+ "type": "field",
1544
+ "label": "Kind",
1545
+ "value": "execute"
1546
+ },
1547
+ {
1548
+ "type": "text",
1549
+ "label": "Command",
1550
+ "text": "bun test"
1551
+ },
1552
+ {
1553
+ "type": "field",
1554
+ "label": "Location",
1555
+ "value": "apps/hub"
1556
+ }
1557
+ ],
1558
+ "preview_complete": true
1559
+ },
1560
+ "dev.agentpod.permission": {
1561
+ "schema_version": 1,
1562
+ "session_id": "acps_3f0c",
1563
+ "request_seq": 12,
1564
+ "title": "Run the test suite",
1565
+ "options": [
1566
+ {
1567
+ "option_id": "allow_once",
1568
+ "name": "Allow once"
1569
+ },
1570
+ {
1571
+ "option_id": "allow_always",
1572
+ "name": "Always allow"
1573
+ },
1574
+ {
1575
+ "option_id": "reject_once",
1576
+ "name": "Reject"
1577
+ },
1578
+ {
1579
+ "option_id": "reject_always",
1580
+ "name": "Never allow"
1581
+ }
1582
+ ]
1583
+ }
1584
+ }
1585
+ },
1586
+ {
1587
+ "why": "twenty-one options: more than any decision card carries",
1588
+ "refusedBy": "schema",
1589
+ "body": {
1590
+ "msgtype": "m.text",
1591
+ "body": "Permission needed: Run the test suite\n\n1. Allow once\n2. Always allow\n3. Reject\n4. Never allow\n\nReply with the number, or the option's name.",
1592
+ "suite_event_type": "dev.agentpod.permission.v2",
1593
+ "schema_version": 1,
1594
+ "request_id": "acps_3f0c:12",
1595
+ "session_id": "acps_3f0c",
1596
+ "request_seq": 12,
1597
+ "title": "Run the test suite",
1598
+ "tool_kind": "execute",
1599
+ "options": [
1600
+ {
1601
+ "id": "o0",
1602
+ "label": "Allow once",
1603
+ "meaning": "approve",
1604
+ "scope": "once"
1605
+ },
1606
+ {
1607
+ "id": "o1",
1608
+ "label": "Allow once",
1609
+ "meaning": "approve",
1610
+ "scope": "once"
1611
+ },
1612
+ {
1613
+ "id": "o2",
1614
+ "label": "Allow once",
1615
+ "meaning": "approve",
1616
+ "scope": "once"
1617
+ },
1618
+ {
1619
+ "id": "o3",
1620
+ "label": "Allow once",
1621
+ "meaning": "approve",
1622
+ "scope": "once"
1623
+ },
1624
+ {
1625
+ "id": "o4",
1626
+ "label": "Allow once",
1627
+ "meaning": "approve",
1628
+ "scope": "once"
1629
+ },
1630
+ {
1631
+ "id": "o5",
1632
+ "label": "Allow once",
1633
+ "meaning": "approve",
1634
+ "scope": "once"
1635
+ },
1636
+ {
1637
+ "id": "o6",
1638
+ "label": "Allow once",
1639
+ "meaning": "approve",
1640
+ "scope": "once"
1641
+ },
1642
+ {
1643
+ "id": "o7",
1644
+ "label": "Allow once",
1645
+ "meaning": "approve",
1646
+ "scope": "once"
1647
+ },
1648
+ {
1649
+ "id": "o8",
1650
+ "label": "Allow once",
1651
+ "meaning": "approve",
1652
+ "scope": "once"
1653
+ },
1654
+ {
1655
+ "id": "o9",
1656
+ "label": "Allow once",
1657
+ "meaning": "approve",
1658
+ "scope": "once"
1659
+ },
1660
+ {
1661
+ "id": "o10",
1662
+ "label": "Allow once",
1663
+ "meaning": "approve",
1664
+ "scope": "once"
1665
+ },
1666
+ {
1667
+ "id": "o11",
1668
+ "label": "Allow once",
1669
+ "meaning": "approve",
1670
+ "scope": "once"
1671
+ },
1672
+ {
1673
+ "id": "o12",
1674
+ "label": "Allow once",
1675
+ "meaning": "approve",
1676
+ "scope": "once"
1677
+ },
1678
+ {
1679
+ "id": "o13",
1680
+ "label": "Allow once",
1681
+ "meaning": "approve",
1682
+ "scope": "once"
1683
+ },
1684
+ {
1685
+ "id": "o14",
1686
+ "label": "Allow once",
1687
+ "meaning": "approve",
1688
+ "scope": "once"
1689
+ },
1690
+ {
1691
+ "id": "o15",
1692
+ "label": "Allow once",
1693
+ "meaning": "approve",
1694
+ "scope": "once"
1695
+ },
1696
+ {
1697
+ "id": "o16",
1698
+ "label": "Allow once",
1699
+ "meaning": "approve",
1700
+ "scope": "once"
1701
+ },
1702
+ {
1703
+ "id": "o17",
1704
+ "label": "Allow once",
1705
+ "meaning": "approve",
1706
+ "scope": "once"
1707
+ },
1708
+ {
1709
+ "id": "o18",
1710
+ "label": "Allow once",
1711
+ "meaning": "approve",
1712
+ "scope": "once"
1713
+ },
1714
+ {
1715
+ "id": "o19",
1716
+ "label": "Allow once",
1717
+ "meaning": "approve",
1718
+ "scope": "once"
1719
+ },
1720
+ {
1721
+ "id": "o20",
1722
+ "label": "Allow once",
1723
+ "meaning": "approve",
1724
+ "scope": "once"
1725
+ }
1726
+ ],
1727
+ "subject": {
1728
+ "id": "acps_3f0c:12",
1729
+ "digest": "bb03bfd8ee6d757e6957d029cd6a7b8e004f16386755ce672e3f97f445563878",
1730
+ "schema": "harness-permission/v1",
1731
+ "revision": 1,
1732
+ "expires_at": "2026-11-07T10:30:00.000Z",
1733
+ "preview": [
1734
+ {
1735
+ "type": "field",
1736
+ "label": "Tool",
1737
+ "value": "Run the test suite"
1738
+ },
1739
+ {
1740
+ "type": "field",
1741
+ "label": "Kind",
1742
+ "value": "execute"
1743
+ },
1744
+ {
1745
+ "type": "text",
1746
+ "label": "Command",
1747
+ "text": "bun test"
1748
+ },
1749
+ {
1750
+ "type": "field",
1751
+ "label": "Location",
1752
+ "value": "apps/hub"
1753
+ }
1754
+ ],
1755
+ "preview_complete": true
1756
+ },
1757
+ "dev.agentpod.permission": {
1758
+ "schema_version": 1,
1759
+ "session_id": "acps_3f0c",
1760
+ "request_seq": 12,
1761
+ "title": "Run the test suite",
1762
+ "options": [
1763
+ {
1764
+ "option_id": "allow_once",
1765
+ "name": "Allow once"
1766
+ },
1767
+ {
1768
+ "option_id": "allow_always",
1769
+ "name": "Always allow"
1770
+ },
1771
+ {
1772
+ "option_id": "reject_once",
1773
+ "name": "Reject"
1774
+ },
1775
+ {
1776
+ "option_id": "reject_always",
1777
+ "name": "Never allow"
1778
+ }
1779
+ ]
1780
+ }
1781
+ }
1420
1782
  }
1421
1783
  ]
1422
1784
  },
@@ -2126,6 +2488,28 @@
2126
2488
  "digest": "y"
2127
2489
  }
2128
2490
  }
2491
+ },
2492
+ {
2493
+ "why": "no options: nothing to answer with",
2494
+ "refusedBy": "schema",
2495
+ "body": {
2496
+ "msgtype": "m.text",
2497
+ "body": "A card is waiting on you — \"Ship the release\" at Build is blocked.\n\nStaging DB down\n\n```\nthe staging database is down\n```\n\n- Resume here\n- Resume at Plan\n- Archive\n\nChoose in an updated app, or [open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40) on the board.",
2498
+ "suite_event_type": "dev.superpipeline.attention.v2",
2499
+ "schema_version": 1,
2500
+ "board_id": "brd_7c1f",
2501
+ "card_id": "crd_6b40",
2502
+ "card_title": "Ship the release",
2503
+ "stage_key": "build",
2504
+ "stage_name": "Build",
2505
+ "wait_id": "wait_0123456789abcdef",
2506
+ "reason": "blocked",
2507
+ "detail": "the staging database is down",
2508
+ "summary": "Staging DB down",
2509
+ "failure_count": null,
2510
+ "options": [],
2511
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_6b40"
2512
+ }
2129
2513
  }
2130
2514
  ]
2131
2515
  },
@@ -2836,16 +3220,73 @@
2836
3220
  },
2837
3221
  "invalid": [
2838
3222
  {
2839
- "why": "switch_to_automatic on an incomplete preview. Nobody turns on posting what the card could not show.",
3223
+ "why": "switch_to_automatic on an incomplete preview. Nobody turns on posting what the card could not show.",
3224
+ "refusedBy": "schema",
3225
+ "body": {
3226
+ "msgtype": "m.text",
3227
+ "body": "Waiting on a live link — \"Announce the release\" was approved to be posted by hand. Once it is live, record its link here.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\n- Record the live link\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
3228
+ "suite_event_type": "dev.superpipeline.delivery.v2",
3229
+ "schema_version": 1,
3230
+ "board_id": "brd_7c1f",
3231
+ "card_id": "crd_6b40",
3232
+ "gate_id": "gate_8f3b",
3233
+ "stage_key": "approve",
3234
+ "card_title": "Announce the release",
3235
+ "subject": {
3236
+ "id": "aps_2c9e71",
3237
+ "digest": "sha256:9b2f4e0c1a7d",
3238
+ "schema": "social-publish/v1",
3239
+ "revision": 1,
3240
+ "expires_at": "2030-01-02T03:04:05Z",
3241
+ "preview": [
3242
+ {
3243
+ "type": "text",
3244
+ "label": "Post",
3245
+ "text": "Our next release ships today.\n\nThanks to everyone who tested it."
3246
+ },
3247
+ {
3248
+ "type": "field",
3249
+ "label": "Account",
3250
+ "value": "@fixture_account on X"
3251
+ }
3252
+ ],
3253
+ "preview_complete": false
3254
+ },
3255
+ "options": [
3256
+ {
3257
+ "id": "record_live_url",
3258
+ "label": "Record the live link",
3259
+ "meaning": "defer",
3260
+ "needs_comment": false,
3261
+ "input": {
3262
+ "kind": "url",
3263
+ "label": "Live link",
3264
+ "required": true,
3265
+ "max_length": 2000
3266
+ }
3267
+ },
3268
+ {
3269
+ "id": "switch_to_automatic",
3270
+ "label": "Post it automatically",
3271
+ "meaning": "approve",
3272
+ "needs_comment": false,
3273
+ "delivery": "automatic"
3274
+ }
3275
+ ],
3276
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_6b40"
3277
+ }
3278
+ },
3279
+ {
3280
+ "why": "record_live_url with no input. The live link is required.",
2840
3281
  "refusedBy": "schema",
2841
3282
  "body": {
2842
3283
  "msgtype": "m.text",
2843
- "body": "Waiting on a live link — \"Announce the release\" was approved to be posted by hand. Once it is live, record its link here.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\n- Record the live link\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
3284
+ "body": "Waiting on a live link — \"Announce the release\" was approved to be posted by hand. Once it is live, record its link here.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\n- Record the live link\n- Post it automatically\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
2844
3285
  "suite_event_type": "dev.superpipeline.delivery.v2",
2845
3286
  "schema_version": 1,
2846
3287
  "board_id": "brd_7c1f",
2847
3288
  "card_id": "crd_6b40",
2848
- "gate_id": "gate_8f3b",
3289
+ "gate_id": "gate_8f3a",
2849
3290
  "stage_key": "approve",
2850
3291
  "card_title": "Announce the release",
2851
3292
  "subject": {
@@ -2866,20 +3307,14 @@
2866
3307
  "value": "@fixture_account on X"
2867
3308
  }
2868
3309
  ],
2869
- "preview_complete": false
3310
+ "preview_complete": true
2870
3311
  },
2871
3312
  "options": [
2872
3313
  {
2873
3314
  "id": "record_live_url",
2874
3315
  "label": "Record the live link",
2875
3316
  "meaning": "defer",
2876
- "needs_comment": false,
2877
- "input": {
2878
- "kind": "url",
2879
- "label": "Live link",
2880
- "required": true,
2881
- "max_length": 2000
2882
- }
3317
+ "needs_comment": false
2883
3318
  },
2884
3319
  {
2885
3320
  "id": "switch_to_automatic",
@@ -2893,7 +3328,7 @@
2893
3328
  }
2894
3329
  },
2895
3330
  {
2896
- "why": "record_live_url with no input. The live link is required.",
3331
+ "why": "camelCase on the Matrix wire. The Matrix field is `max_length`.",
2897
3332
  "refusedBy": "schema",
2898
3333
  "body": {
2899
3334
  "msgtype": "m.text",
@@ -2930,7 +3365,13 @@
2930
3365
  "id": "record_live_url",
2931
3366
  "label": "Record the live link",
2932
3367
  "meaning": "defer",
2933
- "needs_comment": false
3368
+ "needs_comment": false,
3369
+ "input": {
3370
+ "kind": "url",
3371
+ "label": "Live link",
3372
+ "required": true,
3373
+ "maxLength": 2000
3374
+ }
2934
3375
  },
2935
3376
  {
2936
3377
  "id": "switch_to_automatic",
@@ -2944,7 +3385,7 @@
2944
3385
  }
2945
3386
  },
2946
3387
  {
2947
- "why": "camelCase on the Matrix wire. The Matrix field is `max_length`.",
3388
+ "why": "record_live_url asking for text. The live link is a url input.",
2948
3389
  "refusedBy": "schema",
2949
3390
  "body": {
2950
3391
  "msgtype": "m.text",
@@ -2983,10 +3424,10 @@
2983
3424
  "meaning": "defer",
2984
3425
  "needs_comment": false,
2985
3426
  "input": {
2986
- "kind": "url",
3427
+ "kind": "text",
2987
3428
  "label": "Live link",
2988
3429
  "required": true,
2989
- "maxLength": 2000
3430
+ "max_length": 2000
2990
3431
  }
2991
3432
  },
2992
3433
  {
@@ -3001,11 +3442,10 @@
3001
3442
  }
3002
3443
  },
3003
3444
  {
3004
- "why": "record_live_url asking for text. The live link is a url input.",
3445
+ "why": "no body. A stock client would show nothing.",
3005
3446
  "refusedBy": "schema",
3006
3447
  "body": {
3007
3448
  "msgtype": "m.text",
3008
- "body": "Waiting on a live link — \"Announce the release\" was approved to be posted by hand. Once it is live, record its link here.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\n- Record the live link\n- Post it automatically\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
3009
3449
  "suite_event_type": "dev.superpipeline.delivery.v2",
3010
3450
  "schema_version": 1,
3011
3451
  "board_id": "brd_7c1f",
@@ -3040,7 +3480,7 @@
3040
3480
  "meaning": "defer",
3041
3481
  "needs_comment": false,
3042
3482
  "input": {
3043
- "kind": "text",
3483
+ "kind": "url",
3044
3484
  "label": "Live link",
3045
3485
  "required": true,
3046
3486
  "max_length": 2000
@@ -3058,10 +3498,11 @@
3058
3498
  }
3059
3499
  },
3060
3500
  {
3061
- "why": "no body. A stock client would show nothing.",
3501
+ "why": "a subject revision that is not a whole number",
3062
3502
  "refusedBy": "schema",
3063
3503
  "body": {
3064
3504
  "msgtype": "m.text",
3505
+ "body": "Waiting on a live link — \"Announce the release\" was approved to be posted by hand. Once it is live, record its link here.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\n- Record the live link\n- Post it automatically\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
3065
3506
  "suite_event_type": "dev.superpipeline.delivery.v2",
3066
3507
  "schema_version": 1,
3067
3508
  "board_id": "brd_7c1f",
@@ -3073,7 +3514,7 @@
3073
3514
  "id": "aps_2c9e71",
3074
3515
  "digest": "sha256:9b2f4e0c1a7d",
3075
3516
  "schema": "social-publish/v1",
3076
- "revision": 1,
3517
+ "revision": 1.5,
3077
3518
  "expires_at": "2030-01-02T03:04:05Z",
3078
3519
  "preview": [
3079
3520
  {
@@ -6711,6 +7152,125 @@
6711
7152
  }
6712
7153
  ]
6713
7154
  }
7155
+ },
7156
+ {
7157
+ "why": "a subject revision that is not a whole number",
7158
+ "refusedBy": "schema",
7159
+ "body": {
7160
+ "msgtype": "m.text",
7161
+ "body": "Approval needed — \"Announce the release\" at stage `approve`.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\nApproval expires: 2030-01-02T03:04:05Z\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
7162
+ "suite_event_type": "dev.superpipeline.gate.v2",
7163
+ "schema_version": 1,
7164
+ "board_id": "brd_7c1f",
7165
+ "card_id": "crd_6b40",
7166
+ "gate_id": "gate_8f3a",
7167
+ "stage_key": "approve",
7168
+ "return_stage_key": "draft",
7169
+ "card_title": "Announce the release",
7170
+ "produced_by": "agt_31d0",
7171
+ "prompt": "Approve \"Announce the release\"?",
7172
+ "handoff_summary": "Our next release ships today.\n\nThanks to everyone who tested it.",
7173
+ "options": [
7174
+ {
7175
+ "id": "approve_manual",
7176
+ "label": "Approve — I'll post it myself",
7177
+ "meaning": "approve",
7178
+ "needs_comment": false,
7179
+ "delivery": "manual"
7180
+ },
7181
+ {
7182
+ "id": "approve_automatic",
7183
+ "label": "Approve — post automatically",
7184
+ "meaning": "approve",
7185
+ "needs_comment": false,
7186
+ "delivery": "automatic"
7187
+ },
7188
+ {
7189
+ "id": "request_changes",
7190
+ "label": "Request changes",
7191
+ "meaning": "revise",
7192
+ "needs_comment": true
7193
+ },
7194
+ {
7195
+ "id": "reject",
7196
+ "label": "Reject",
7197
+ "meaning": "reject",
7198
+ "needs_comment": false
7199
+ }
7200
+ ],
7201
+ "subject": {
7202
+ "id": "aps_2c9e71",
7203
+ "digest": "sha256:9b2f4e0c1a7d",
7204
+ "schema": "social-publish/v1",
7205
+ "revision": 1.5,
7206
+ "expires_at": "2030-01-02T03:04:05Z",
7207
+ "preview": [
7208
+ {
7209
+ "type": "text",
7210
+ "label": "Post",
7211
+ "text": "Our next release ships today.\n\nThanks to everyone who tested it."
7212
+ },
7213
+ {
7214
+ "type": "field",
7215
+ "label": "Account",
7216
+ "value": "@fixture_account on X"
7217
+ },
7218
+ {
7219
+ "type": "field",
7220
+ "label": "Approval expires",
7221
+ "value": "2030-01-02T03:04:05Z"
7222
+ }
7223
+ ],
7224
+ "preview_complete": true
7225
+ },
7226
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_6b40"
7227
+ }
7228
+ },
7229
+ {
7230
+ "why": "no options: nothing to answer with",
7231
+ "refusedBy": "schema",
7232
+ "body": {
7233
+ "msgtype": "m.text",
7234
+ "body": "Approval needed — \"Announce the release\" at stage `approve`.\n\nPost:\n```\nOur next release ships today.\n\nThanks to everyone who tested it.\n```\n\nAccount: @fixture_account on X\n\nApproval expires: 2030-01-02T03:04:05Z\n\n[Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_6b40)",
7235
+ "suite_event_type": "dev.superpipeline.gate.v2",
7236
+ "schema_version": 1,
7237
+ "board_id": "brd_7c1f",
7238
+ "card_id": "crd_6b40",
7239
+ "gate_id": "gate_8f3a",
7240
+ "stage_key": "approve",
7241
+ "return_stage_key": "draft",
7242
+ "card_title": "Announce the release",
7243
+ "produced_by": "agt_31d0",
7244
+ "prompt": "Approve \"Announce the release\"?",
7245
+ "handoff_summary": "Our next release ships today.\n\nThanks to everyone who tested it.",
7246
+ "options": [],
7247
+ "subject": {
7248
+ "id": "aps_2c9e71",
7249
+ "digest": "sha256:9b2f4e0c1a7d",
7250
+ "schema": "social-publish/v1",
7251
+ "revision": 1,
7252
+ "expires_at": "2030-01-02T03:04:05Z",
7253
+ "preview": [
7254
+ {
7255
+ "type": "text",
7256
+ "label": "Post",
7257
+ "text": "Our next release ships today.\n\nThanks to everyone who tested it."
7258
+ },
7259
+ {
7260
+ "type": "field",
7261
+ "label": "Account",
7262
+ "value": "@fixture_account on X"
7263
+ },
7264
+ {
7265
+ "type": "field",
7266
+ "label": "Approval expires",
7267
+ "value": "2030-01-02T03:04:05Z"
7268
+ }
7269
+ ],
7270
+ "preview_complete": true
7271
+ },
7272
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_6b40"
7273
+ }
6714
7274
  }
6715
7275
  ]
6716
7276
  },
@@ -8106,6 +8666,99 @@
8106
8666
  },
8107
8667
  "approval_request_id": "apr_5d2e9c41"
8108
8668
  }
8669
+ },
8670
+ {
8671
+ "why": "a subject revision that is not a whole number",
8672
+ "refusedBy": "schema",
8673
+ "body": {
8674
+ "msgtype": "m.text",
8675
+ "body": "An agent is waiting on you — \"Upgrade the build image\" at stage `build`.\n\nEdit app.js in the workspace?\n\n1. Approve\n2. Approve for this run\n3. Always allow\n4. Deny\n\nReply with the number, or the option's name. [Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_51d0)\n\nThis approves an exact operation. Approve it in an updated app, which shows what it does, or on the board. A reply here can only decline it.",
8676
+ "suite_event_type": "dev.superpipeline.question.v2",
8677
+ "schema_version": 1,
8678
+ "elicitation_id": "elc_9b44",
8679
+ "board_id": "brd_7c1f",
8680
+ "card_id": "crd_51d0",
8681
+ "run_id": "run_12",
8682
+ "stage_key": "build",
8683
+ "card_title": "Upgrade the build image",
8684
+ "asked_by": "agt_31d0",
8685
+ "question": "Edit app.js in the workspace?",
8686
+ "options": [
8687
+ {
8688
+ "id": "approve",
8689
+ "label": "Approve",
8690
+ "meaning": "approve",
8691
+ "needs_comment": false,
8692
+ "scope": "once"
8693
+ },
8694
+ {
8695
+ "id": "approve-run",
8696
+ "label": "Approve for this run",
8697
+ "meaning": "approve",
8698
+ "needs_comment": false,
8699
+ "scope": "run"
8700
+ },
8701
+ {
8702
+ "id": "always",
8703
+ "label": "Always allow",
8704
+ "meaning": "approve",
8705
+ "needs_comment": false,
8706
+ "scope": "always",
8707
+ "requires": "workspace-admin"
8708
+ },
8709
+ {
8710
+ "id": "deny",
8711
+ "label": "Deny",
8712
+ "meaning": "reject",
8713
+ "needs_comment": false,
8714
+ "scope": "once"
8715
+ }
8716
+ ],
8717
+ "subject": {
8718
+ "id": "8f9a0d0e-4b2a-4c1e-9c55-1a2b3c4d5e6f",
8719
+ "digest": "0588c96c7eff47e1a83d9fc1d0ecda3cc3b72e559a5c402bb9da29d9851dbceb",
8720
+ "schema": "salaam-operation/v1",
8721
+ "revision": 1.5,
8722
+ "expires_at": "2026-11-07T10:30:00.000Z",
8723
+ "preview": [
8724
+ {
8725
+ "type": "text",
8726
+ "text": "Edit app.js in the workspace"
8727
+ },
8728
+ {
8729
+ "type": "field",
8730
+ "label": "File",
8731
+ "value": "app.js · edit · 16 bytes"
8732
+ },
8733
+ {
8734
+ "type": "text",
8735
+ "text": "console.log(1);\n"
8736
+ }
8737
+ ],
8738
+ "preview_complete": true
8739
+ },
8740
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_51d0"
8741
+ }
8742
+ },
8743
+ {
8744
+ "why": "no options: nothing to answer with",
8745
+ "refusedBy": "schema",
8746
+ "body": {
8747
+ "msgtype": "m.text",
8748
+ "body": "An agent is waiting on you — \"Upgrade the build image\" at stage `build`.\n\nThe tests need network access. May I run them?\n\n1. Run the tests\n2. Skip them\n3. Something else\n\nReply with the number, or the option's name. [Open the card](https://superpipeline.dev/b/brd_7c1f/c/crd_51d0)",
8749
+ "suite_event_type": "dev.superpipeline.question.v2",
8750
+ "schema_version": 1,
8751
+ "elicitation_id": "elc_7f3c",
8752
+ "board_id": "brd_7c1f",
8753
+ "card_id": "crd_51d0",
8754
+ "run_id": "run_12",
8755
+ "stage_key": "build",
8756
+ "card_title": "Upgrade the build image",
8757
+ "asked_by": "agt_31d0",
8758
+ "question": "The tests need network access. May I run them?",
8759
+ "options": [],
8760
+ "deep_link": "https://superpipeline.dev/b/brd_7c1f/c/crd_51d0"
8761
+ }
8109
8762
  }
8110
8763
  ]
8111
8764
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superjackfruitlabs/treaty-matrix-events",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "The board-room Matrix event contract: JSON Schemas, builders and parsers for the gates, questions, follow-ups and waiting cards Super Jackfruit Labs products carry into chat, and the answers back.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,6 +49,8 @@
49
49
  },
50
50
  "options": {
51
51
  "type": "array",
52
+ "minItems": 1,
53
+ "maxItems": 20,
52
54
  "items": {
53
55
  "type": "object",
54
56
  "required": ["id", "label", "meaning"],
@@ -173,7 +175,8 @@
173
175
  "minLength": 1
174
176
  },
175
177
  "revision": {
176
- "type": "number"
178
+ "type": "integer",
179
+ "minimum": 0
177
180
  },
178
181
  "expires_at": {
179
182
  "type": ["string", "null"],
@@ -75,6 +75,7 @@
75
75
  },
76
76
  "options": {
77
77
  "type": "array",
78
+ "minItems": 1,
78
79
  "maxItems": 20,
79
80
  "items": {
80
81
  "type": "object",
@@ -249,7 +249,8 @@
249
249
  "minLength": 1
250
250
  },
251
251
  "revision": {
252
- "type": "number"
252
+ "type": "integer",
253
+ "minimum": 0
253
254
  },
254
255
  "expires_at": {
255
256
  "type": ["string", "null"],
@@ -63,6 +63,7 @@
63
63
  },
64
64
  "options": {
65
65
  "type": "array",
66
+ "minItems": 1,
66
67
  "maxItems": 20,
67
68
  "items": {
68
69
  "$ref": "#/$defs/gateOption"
@@ -208,7 +209,8 @@
208
209
  "minLength": 1
209
210
  },
210
211
  "revision": {
211
- "type": "number"
212
+ "type": "integer",
213
+ "minimum": 0
212
214
  },
213
215
  "expires_at": {
214
216
  "type": ["string", "null"],
@@ -119,7 +119,7 @@
119
119
  },
120
120
  "allOf": [
121
121
  {
122
- "description": "free_text only on a question with no options: text alone answers only a question with nothing to choose.",
122
+ "description": "free_text only on a question with no options: text alone answers only a question with nothing to choose. Without free_text, there is at least one option to answer with.",
123
123
  "if": {
124
124
  "required": ["free_text"]
125
125
  },
@@ -129,6 +129,13 @@
129
129
  "maxItems": 0
130
130
  }
131
131
  }
132
+ },
133
+ "else": {
134
+ "properties": {
135
+ "options": {
136
+ "minItems": 1
137
+ }
138
+ }
132
139
  }
133
140
  },
134
141
  {
@@ -265,7 +272,8 @@
265
272
  "minLength": 1
266
273
  },
267
274
  "revision": {
268
- "type": "number"
275
+ "type": "integer",
276
+ "minimum": 0
269
277
  },
270
278
  "expires_at": {
271
279
  "type": ["string", "null"],