@superjackfruitlabs/treaty-event-schemas 0.0.12 → 0.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superjackfruitlabs/treaty-event-schemas",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "JSON Schemas for the events Super Jackfruit Labs products send, and the catalogue that names their CloudEvents types.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/schemas/README.md CHANGED
@@ -19,6 +19,7 @@ names each event's CloudEvents `type` and the `dataschema` it points at, which i
19
19
  | `decision.pulled_back.v1.json` | `decision.pulled_back` | `DecisionPulledBackBody`, same file |
20
20
  | `check.failed.v1.json` | `check.failed` | `CheckFailedBody`, same file |
21
21
  | `check.overridden.v1.json` | `check.overridden` | `CheckOverriddenBody`, same file |
22
+ | `card.ready.v1.json` | `card.ready` | `CardReadyBody`, `apps/api/src/board/placement-window.ts` |
22
23
 
23
24
  The schemas are written from SuperPipeline's types. SuperPipeline's own test validates the bodies
24
25
  its builders produce against them, so a type that moves without its schema fails there.
@@ -33,6 +34,10 @@ Every body a schema accepts there must also pass the carrier's own check in
33
34
  except `boardId: null`: SuperPipeline's type allows it and the carrier refuses it, as it cannot
34
35
  route an event to no board.
35
36
 
37
+ `card.ready` is not a chat event: no carrier reads it. A board opted into scheduling sends it
38
+ when a card becomes ready to claim, so a placement service can place the card inside the board's
39
+ placement window instead of waiting for its next sweep.
40
+
36
41
  ## Not here
37
42
 
38
43
  - **Run reports** go to SuperWitness (`POST /v1/runs`), which owns and publishes their schema at
@@ -158,6 +158,12 @@
158
158
  "pushName": "link.removed",
159
159
  "type": "com.superjackfruit.superpipeline.link.removed.v1",
160
160
  "dataschema": "https://raw.githubusercontent.com/SuperJackfruitLabs/treaty/main/schemas/superpipeline/record.v1.json"
161
+ },
162
+ {
163
+ "producer": "superpipeline",
164
+ "pushName": "card.ready",
165
+ "type": "com.superjackfruit.superpipeline.card.ready.v1",
166
+ "dataschema": "https://raw.githubusercontent.com/SuperJackfruitLabs/treaty/main/schemas/superpipeline/card.ready.v1.json"
161
167
  }
162
168
  ],
163
169
  "elsewhere": [
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/SuperJackfruitLabs/treaty/main/schemas/superpipeline/card.ready.v1.json",
4
+ "title": "SuperPipeline card.ready",
5
+ "description": "A card became ready to be claimed on a board opted into scheduling: it reached a stage an agent may claim from in a claimable state, or was resumed or returned there. A placement service reacts to it at once instead of waiting for its sweep; it is a hint, and the board read stays the truth. Sent only by a board with a placement window (charter: SuperDispatch owns the scheduler). Mirrors SuperPipeline's CardReadyBody (apps/api/src/board/placement-window.ts). Readers ignore properties they do not know.",
6
+ "type": "object",
7
+ "required": ["event", "boardId", "cardId", "stageKey", "readyAt", "ts"],
8
+ "properties": {
9
+ "event": {
10
+ "const": "card.ready"
11
+ },
12
+ "boardId": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "description": "Never null: the event is routed by its board."
16
+ },
17
+ "cardId": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "stageKey": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "description": "The stage the card is ready at."
25
+ },
26
+ "readyAt": {
27
+ "$ref": "#/$defs/timestamp",
28
+ "description": "When the card became ready: where its placement window starts."
29
+ },
30
+ "placementWindowUntil": {
31
+ "$ref": "#/$defs/timestamp",
32
+ "description": "Until when the board holds the card back from pull so it can be placed. Absent when the board has no window. A hold made inside the window is claimable by its agent at once."
33
+ },
34
+ "ts": {
35
+ "$ref": "#/$defs/timestamp"
36
+ }
37
+ },
38
+ "$defs": {
39
+ "timestamp": {
40
+ "type": "string",
41
+ "format": "date-time"
42
+ }
43
+ }
44
+ }