wicked-crew-api-types 0.130.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 +70 -12
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1231,21 +1231,45 @@ export interface RosterSeat {
1231
1231
  [k: string]: unknown;
1232
1232
  }
1233
1233
 
1234
- /** `RosterSeat.version` (api-types 0.115.0). */
1235
- export interface SeatVersion {
1234
+ /** Why a pinned seat reads `unproven` (api-types 0.131.0, crew#1004): `no_answer` — the pin's own
1235
+ * `--version` check got no answer, so nothing confirms the build (it was not shown to differ);
1236
+ * `different_build` — the check answered naming a build other than the pinned one (`observed`);
1237
+ * `invalid_answer` — the check answered, but in a shape it cannot confirm (its first line is not
1238
+ * the pinned build byte for byte) and without naming another build. A build is named by its id
1239
+ * alone, pre-release and build suffixes included (`1.18.31`, `1.17.18-rc.1`), only as a whole
1240
+ * token (`1.18.31.4` names none), never by the presentation around it: `opencode (1.17.18)`, a
1241
+ * colour-coded `1.17.18` and `v1.17.18,` name only the pinned build; `1.17.18-beta` names another. */
1242
+ export type SeatVersionUnprovenWhy = 'no_answer' | 'different_build' | 'invalid_answer';
1243
+
1244
+ /**
1245
+ * `RosterSeat.version` (api-types 0.115.0; `why` and `observed` 0.131.0). `status`: `proven` — the
1246
+ * pin's check answered with the pinned build; `unproven` — it did not, and governance fails closed,
1247
+ * with `why` saying which case and, on `different_build`, `observed` naming the build the check
1248
+ * saw; `no_pin` — the seat pins no build.
1249
+ *
1250
+ * `status` comes from the pin's check alone (it mirrors the engine's spawn-time check), never from
1251
+ * `installed`. The two are separate snapshots: the seat's own `--version` reading (`installed`,
1252
+ * `checked_at`) and the pin's check are cached apart, each with its own TTL, so for up to one TTL
1253
+ * after an upgrade `installed` may still read the pinned build while `why` is already
1254
+ * `different_build`. The build the check saw is `observed`, never `installed`; `installed` equal to
1255
+ * `proven` says nothing about the pin holding (crew#1004).
1256
+ */
1257
+ export type SeatVersion = {
1236
1258
  /** The first non-empty line of the seat's `--version`, home written `~`; `null` when it did not answer. */
1237
1259
  installed: string | null;
1238
- /** The build the seat's governance was proven on (`acp.verified_version`); `null` when it pins none. */
1239
- proven: string | null;
1240
- /** `proven` — the installed build is the pinned one; `unproven` — it is not (governance fails
1241
- * closed); `no_pin` — the seat pins no build. */
1242
- status: 'proven' | 'unproven' | 'no_pin';
1243
- /** ISO-8601 of the reading. */
1260
+ /** ISO-8601 of the `installed` reading. */
1244
1261
  checked_at: string;
1245
1262
  /** How the binary on PATH was installed, from its resolved path: under `node_modules` = `npm`, a
1246
1263
  * Homebrew prefix = `brew`, else `other`; `null` when it is not on PATH. */
1247
1264
  install_source: 'npm' | 'brew' | 'other' | null;
1248
- }
1265
+ } & (
1266
+ // `proven`: the build the seat's governance was proven on (`acp.verified_version`), `null` only
1267
+ // when it pins none. `observed`: the build the pin's check saw, on `different_build` only.
1268
+ | { status: 'no_pin'; proven: null }
1269
+ | { status: 'proven'; proven: string }
1270
+ | { status: 'unproven'; proven: string; why: 'no_answer' | 'invalid_answer' }
1271
+ | { status: 'unproven'; proven: string; why: 'different_build'; observed: string }
1272
+ );
1249
1273
 
1250
1274
  /** `RosterSeat.account` (api-types 0.115.0). */
1251
1275
  export interface SeatAccount {
@@ -1304,7 +1328,10 @@ export type SeatQeReviewer =
1304
1328
  /**
1305
1329
  * One `RosterSeat.issues` entry (api-types 0.115.0). Today's codes: `signed_out`, `qe_blocked`
1306
1330
  * (problems); `quota`, `usage_limit`, `benched`, `codex_worktree`, `host_floor` and `host_floor_unknown`
1307
- * (unreleased, wicked-core#976), `version_unproven`,
1331
+ * (unreleased, wicked-core#976), `version_unproven` (`params.why`: `no_answer` | `different_build` | `invalid_answer`,
1332
+ * api-types 0.131.0 — the same as `RosterSeat.version.why`; `params.observed`, on `different_build`
1333
+ * only: the build the pin's check saw, the same as `RosterSeat.version.observed`; `params.proven`;
1334
+ * `params.installed` when the seat's own `--version` answered),
1308
1335
  * `unchecked` (`params.why`: `no_governance` | `no_host_boundary`), `fence_scoped`,
1309
1336
  * `live_check_failed` (warnings); `opt_in`, `no_qe`, `unverified` (notes). A client must tolerate
1310
1337
  * an unknown code.
@@ -1530,7 +1557,15 @@ export interface RunDiff {
1530
1557
  base?: string;
1531
1558
  }
1532
1559
 
1533
- /** 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
+ */
1534
1569
  export interface GateInfo {
1535
1570
  runId: string;
1536
1571
  ord: number;
@@ -1551,6 +1586,20 @@ export interface GateInfo {
1551
1586
  * kind, never infer it from the unit. ABSENT on an older daemon and when the engine did not say.
1552
1587
  */
1553
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;
1554
1603
  /** (crew ≥ 0.9.0) The gated unit's persisted receipt (`WorkUnit.assurance`) — what assured the
1555
1604
  * work this gate asks about. `null` when the unit carries none (no gate evaluated it yet, or an
1556
1605
  * older engine); ABSENT on an older daemon. */
@@ -1647,7 +1696,16 @@ export interface GateDecision {
1647
1696
  * mismatch, confirming nothing: the gate was answered elsewhere or replaced while the decision
1648
1697
  * waited (a skin's undo window). When the daemon cannot tell which gate is open it answers
1649
1698
  * **409** `{ error, code: 'gate_unknown' }` — refresh the gate and decide again. Absent = today's
1650
- * 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`.
1651
1709
  */
1652
1710
  ord?: number;
1653
1711
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-crew-api-types",
3
- "version": "0.130.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",