wicked-crew-api-types 0.131.0 → 0.132.0

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.
Files changed (2) hide show
  1. package/index.d.ts +33 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1557,7 +1557,15 @@ export interface RunDiff {
1557
1557
  base?: string;
1558
1558
  }
1559
1559
 
1560
- /** The daemon's cached open-gate record (`GET /runs/:id/gate`, DES-STUDIO-001 §3.3). */
1560
+ /**
1561
+ * The daemon's cached open-gate record (`GET /runs/:id/gate`, DES-STUDIO-001 §3.3).
1562
+ *
1563
+ * (api-types 0.132.0) The read answers **503** `{ error, code: 'gate_unstable' }` when live gate
1564
+ * events kept landing while the daemon read the run's record and nothing could be verified — retry
1565
+ * — and **409** `{ error, code: 'gate_unknown' }` when the engine's open gate rows disagree on the
1566
+ * ord. It serves the newest of the agreeing rows: the one a decision is judged by.
1567
+ * A decision is never authorized from this record: see {@link GateDecision.ord}.
1568
+ */
1561
1569
  export interface GateInfo {
1562
1570
  runId: string;
1563
1571
  ord: number;
@@ -1578,6 +1586,20 @@ export interface GateInfo {
1578
1586
  * kind, never infer it from the unit. ABSENT on an older daemon and when the engine did not say.
1579
1587
  */
1580
1588
  gateKind?: string;
1589
+ /**
1590
+ * (api-types 0.132.0; issue #969) The answer tokens the engine offered on this gate — mirrors the
1591
+ * opening `awaitingHuman.choices` (e.g. a `team_dispute` gate's
1592
+ * `['approve', 'request_changes', 'reject']`), so a client that missed the live frame (reload,
1593
+ * late join, second tab) renders the same answers. ABSENT on an older daemon and when the engine
1594
+ * offered none; never empty.
1595
+ */
1596
+ choices?: string[];
1597
+ /**
1598
+ * (api-types 0.132.0; issue #969) The index into {@link GateInfo.choices} of the engine's
1599
+ * recommended answer — mirrors `awaitingHuman.recommended`. ABSENT on an older daemon, when the
1600
+ * engine recommended none, and whenever `choices` is absent.
1601
+ */
1602
+ recommended?: number;
1581
1603
  /** (crew ≥ 0.9.0) The gated unit's persisted receipt (`WorkUnit.assurance`) — what assured the
1582
1604
  * work this gate asks about. `null` when the unit carries none (no gate evaluated it yet, or an
1583
1605
  * older engine); ABSENT on an older daemon. */
@@ -1674,7 +1696,16 @@ export interface GateDecision {
1674
1696
  * mismatch, confirming nothing: the gate was answered elsewhere or replaced while the decision
1675
1697
  * waited (a skin's undo window). When the daemon cannot tell which gate is open it answers
1676
1698
  * **409** `{ error, code: 'gate_unknown' }` — refresh the gate and decide again. Absent = today's
1677
- * behaviour (no gate check).
1699
+ * behaviour (no gate check). (api-types 0.132.0) The comparison is made against the engine's
1700
+ * durable open gate rows, read under the run's decision lock immediately before the confirm —
1701
+ * never the daemon's gate cache — and judged by ORD AGREEMENT, not row count:
1702
+ * - no open gate row → **409** `gate_unknown`;
1703
+ * - open rows that disagree on the ord (the record is ambiguous) → **409** `gate_unknown`;
1704
+ * - the rows agree on an ord other than this one → **409** `gate_changed` with `openOrd`;
1705
+ * - the rows agree on this ord — one row or several (a keyed plan gate plus its recovery row) →
1706
+ * authorized.
1707
+ * The same reading judges a decision without `ord` (ambiguous rows → `gate_unknown`) and a gated
1708
+ * `POST /runs/:id/resume` or `/reassign`.
1678
1709
  */
1679
1710
  ord?: number;
1680
1711
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.131.0",
3
+ "version": "0.132.0",
4
4
  "description": "The wire contract of the wicked-crew daemon's /api/v1 REST surface and /ws CoreEvent frames \u2014 types only, zero runtime",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",