@pouchy_ai/world-sdk 0.29.0 → 0.30.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @pouchy_ai/world-sdk
2
2
 
3
+ ## 0.30.0
4
+
5
+ - **`SKIP_COST_MODEL_VERSION` / `SKIP_COST_MODEL_DIGEST`** — the cost model's
6
+ identity as of this build, so you can detect that the server regrouped a code
7
+ instead of finding out from your ledger.
8
+
9
+ Asked directly after 0.29.0 shipped: does `skipSpentNoModelCall` track the
10
+ server, and would a regrouping be a major bump? The answers are **no** and
11
+ **we will not promise that**. A published package is a SNAPSHOT — regroup a
12
+ code server-side and a pinned client keeps the old answer forever, with no
13
+ error, no code change of yours and green tests. And a promise to bump is a
14
+ claim about human behaviour with no process behind it; the same shape this
15
+ project already declined to sign for the moderation defaults.
16
+
17
+ So the grouping is published as data instead. `GET /v1/world/openapi` carries
18
+ `x-pouchy-cost-model` (`version`, `digest`, `noModelCall`, `modelMayHaveRun`)
19
+ on the `skippedRoles[].code` schema. Compare it against these two constants
20
+ and alarm on a mismatch — a check that fires on the condition itself rather
21
+ than on our remembering to signal it.
22
+
23
+ The digest covers group MEMBERSHIP only: reordering the enum or rewording a
24
+ comment never moves it; a code changing group always does.
25
+
3
26
  ## 0.29.0
4
27
 
5
28
  - **`skippedRoles[].code`** — the machine half of "why this role did not
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * a project is running — which is exactly the field you reach for when a
5
5
  * customer's integration behaves like an older SDK than they say they have.
6
6
  * It sat at '0.1.0' for eight releases before anything compared the two. */
7
- export declare const WORLD_SDK_VERSION = "0.29.0";
7
+ export declare const WORLD_SDK_VERSION = "0.30.0";
8
8
  export declare const DEFAULT_BASE_URL = "https://pouchy.ai/v1";
9
9
  /** One direction a beat could take. The WHOLE of what a deliberation shows a
10
10
  * player: no reasoning, no role secrets, no simulated effects, no scores. */
@@ -542,6 +542,21 @@ export type WorldRejectionCode = 'narrative_conflict' | 'policy_rejection' | 'sc
542
542
  * so a consumer does not re-derive it. Absent on turns from a server predating
543
543
  * the taxonomy — read that as unknown, never as a value. */
544
544
  export type WorldSkipCode = 'not_focused' | 'role_cap_reached' | 'no_actor_bound' | 'deadline_exhausted' | 'not_admitted' | 'actor_unavailable' | 'session_busy' | 'content_policy' | 'turn_error' | 'no_message' | 'effect_refused' | 'conflict_undelivered';
545
+ /** The cost model's version and digest AS OF THIS SDK BUILD.
546
+ *
547
+ * `skipSpentNoModelCall` below is a SNAPSHOT — a published package cannot
548
+ * track a server that regroups a code later, and nothing would error if it
549
+ * did: your code would not change, your tests would stay green, and your
550
+ * billing would drift. So compare these against `x-pouchy-cost-model` in
551
+ * `GET /v1/world/openapi` (the same document you already read for the enum) and
552
+ * alarm on a mismatch. That check is worth more than any promise about version
553
+ * bumps, because it fires on the condition itself rather than on our
554
+ * remembering to signal it.
555
+ *
556
+ * The digest covers group MEMBERSHIP only: reordering the enum or rewording a
557
+ * comment never moves it. */
558
+ export declare const SKIP_COST_MODEL_VERSION = "1.0.0";
559
+ export declare const SKIP_COST_MODEL_DIGEST = "4a8369322817e3fa";
545
560
  /** Did this skip happen before any model call — is the role's silence free?
546
561
  *
547
562
  * `turn_error` is deliberately NOT in the free set even though it often is:
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import { createHash, createHmac, randomUUID } from 'node:crypto';
23
23
  * a project is running — which is exactly the field you reach for when a
24
24
  * customer's integration behaves like an older SDK than they say they have.
25
25
  * It sat at '0.1.0' for eight releases before anything compared the two. */
26
- export const WORLD_SDK_VERSION = '0.29.0';
26
+ export const WORLD_SDK_VERSION = '0.30.0';
27
27
  export const DEFAULT_BASE_URL = 'https://pouchy.ai/v1';
28
28
  /** Read the commit turn id out of an envelope, so the signature covers the id
29
29
  * the server will commit under. The payload half is base64url JSON; the
@@ -306,6 +306,21 @@ export function describeTurn(result) {
306
306
  ` delivery ${result.deliveryStatus}`
307
307
  };
308
308
  }
309
+ /** The cost model's version and digest AS OF THIS SDK BUILD.
310
+ *
311
+ * `skipSpentNoModelCall` below is a SNAPSHOT — a published package cannot
312
+ * track a server that regroups a code later, and nothing would error if it
313
+ * did: your code would not change, your tests would stay green, and your
314
+ * billing would drift. So compare these against `x-pouchy-cost-model` in
315
+ * `GET /v1/world/openapi` (the same document you already read for the enum) and
316
+ * alarm on a mismatch. That check is worth more than any promise about version
317
+ * bumps, because it fires on the condition itself rather than on our
318
+ * remembering to signal it.
319
+ *
320
+ * The digest covers group MEMBERSHIP only: reordering the enum or rewording a
321
+ * comment never moves it. */
322
+ export const SKIP_COST_MODEL_VERSION = '1.0.0';
323
+ export const SKIP_COST_MODEL_DIGEST = '4a8369322817e3fa';
309
324
  /** Did this skip happen before any model call — is the role's silence free?
310
325
  *
311
326
  * `turn_error` is deliberately NOT in the free set even though it often is:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pouchy_ai/world-sdk",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Server-side TypeScript client for Pouchy World \u2014 story packages, world definitions, world sessions, coordinated turns, trusted events, replay verification and script drafts. Node only: it holds a project Secret Key and a source signing key, which never belong in a browser or a mobile app.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",