@revturbine/sdk 0.11.3 → 0.11.5

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,1514 +1,1605 @@
1
- # Changelog
2
-
3
- Release notes and breaking changes for the RevTurbine SDKs. `@revturbine/sdk` (npm), `revturbine`
4
- (PyPI) and `revturbine` (crates.io) are **version-locked** — they always ship the
5
- same version number, so a version here applies to all three unless an entry says
6
- otherwise.
7
-
8
- Verified for `0.8.1`: npm `0.8.1`, PyPI `0.8.1`, crates.io `0.8.1` (2026-09-14).
9
-
10
- Every breaking change is recorded in the same shape, because the thing that cost
11
- an integration the most time was not the change itself but not being able to
12
- answer *"which version broke this, and which version made it loud?"*:
13
-
14
- | field | what it answers |
15
- |---|---|
16
- | **What changed** | the old shape and the new one, concretely |
17
- | **Landed in** | the version that introduced the change |
18
- | **Fail-closed in** | the version where the old shape stopped being silently tolerated. Often the same version; when it is **not**, the gap is where integrations break quietly. |
19
- | **Proving test** | the test in this repo that would fail if the behaviour regressed |
20
-
21
- A change whose "Fail-closed in" is later than its "Landed in" had a window where
22
- the old shape was accepted and did nothing. Those windows are the expensive ones.
23
-
24
- > **What this file is not yet.** A CI guard fails any PR that changes a
25
- > `@public`-tagged export signature without touching this file. That tagging
26
- > was thin (4 of ~73 methods) until BL-0005 (2026-09-22, no release — TSDoc
27
- > and snapshot only) widened it to **34** of `RevTurbineCustomerSdk`'s **67**
28
- > non-private methods, plus 5 provider/hook entry points
29
- > (`initRevTurbine`, `RevTurbineProvider`, `useCan`, `useEntitlement`,
30
- > `useGatedAction`) — every method a customer-facing guide, skill, the
31
- > starter, or a demo app calls directly. The remaining ~33 methods are
32
- > internal-only paths (called only by the SDK's own placement components,
33
- > React bindings, or other internal packages) and stay untagged, so a
34
- > breaking change to one of *those* still will not be caught automatically —
35
- > it depends on whoever writes the PR. Entries here are reliable; the absence
36
- > of an entry for a currently-untagged method is not yet proof that nothing
37
- > changed.
38
-
39
- > **Note on 0.x.** These packages are pre-1.0, so breaking changes ship in the
40
- > **minor** position (`0.6.0` → `0.7.0`), not the major. `npm`'s caret on a `0.x`
41
- > range does **not** span minors, so `^0.7.0` will not silently pull `0.8.0`.
42
-
43
- Built-in decision reason values have a separate reviewed
44
- [compatibility baseline](docs/reason-code-contract.md). Live fixture checks
45
- protect those values independently of `@public` method tags; baseline changes
46
- also require a changelog entry.
47
-
48
- ---
49
-
50
- ## 0.11.3
51
-
52
- ### `placement_interaction` now carries `rule_handle` (BL-0182)
53
-
54
- **What changed.** #527 (BL-0062) stamped `rule_handle` at every verdict emit
55
- site by reading `decision.output.rule_id`, but `placement_interaction` is not
56
- a lifecycle event and does not spread `placementLifecycleBase` — its
57
- placement keys are all optional, because a bare `trackTreatmentInteraction`
58
- caller may supply none of them — so the click between exposure and outcome
59
- was the one step of the funnel with no rule key. That is the step
60
- click-through and CTR are computed over: the funnel was sliceable by rule at
61
- both ends and not in the middle.
62
-
63
- Five emit sites now reach the same stamped payload: `trackTreatmentInteraction`
64
- (the projection itself), `PlacementController.trackInteraction`
65
- (dismiss / remind_me_later / cta_clicked / cta_completed — and therefore every
66
- React hook and `useSurfaceSlot` / `FixedSurfaceSlot` click handler built on
67
- it), `PlacementController.fireImpression`, `trackOutputInteraction`
68
- (output-addressed `convert()` / `dismiss()` / `snooze()`), and the
69
- server-action `trackResult` resolver.
70
-
71
- Spread, not set: `rule_handle` is **absent** when no decision was in scope
72
- (a bare `trackTreatmentInteraction` call with no placement context), and
73
- `null` on the wire means "a rule was selected and none matched" — conflating
74
- the two would poison the slice's coverage numbers. The unknown-output branch
75
- of `trackOutputInteraction` stamps nothing on purpose: no decision from this
76
- SDK produced that output, so there is no rule to name.
77
-
78
- Companion to `revturbine-scaffold#391`, which added `rule_handle` to the
79
- `placement_interaction` payload contract and `ruleHandle` to
80
- `RevTurbineTreatmentInteractionInput` (published as `@revt-eng/*` v0.1.339,
81
- pinned in this release).
82
-
83
- **No wire-shape change beyond the new optional field.** `rule_handle` is
84
- optional-and-nullable on the schema side (#391), which keeps every
85
- already-deployed SDK out of `quarantineVerdict`. `@public` signatures are
86
- unchanged (`web-sdk/generated/public-api.json` untouched) and
87
- `flushInteractionQueue` still maps the treatment-interaction record field by
88
- field, so `ruleHandle` never reaches a customer webhook.
89
-
90
- **Python and Rust are unaffected.** Neither port emits events.
91
-
92
- **Landed in** `0.11.3` (BL-0182, #530).
93
-
94
- **Fail-closed in** not applicable — additive field, nothing old is rejected.
95
-
96
- **Proving test:** `web-sdk/customer-side-canonical-interaction.test.ts`.
97
-
98
- ---
99
-
100
- ### A gate no longer paywalls forever when it loses the cold-start config race (BL-0179)
101
-
102
- **What changed.** BL-0177 (below) split `config_unavailable` into a transient and
103
- a terminal state for **placements** and left `checkEntitlement` on the old
104
- behaviour. So the same cold-start race denied entitlements instead: while the
105
- Playbook load was in flight, `checkEntitlement` — and therefore `can()`,
106
- `gate()`, `useCan`, `useEntitlement` and `useGatedAction` — returned the
107
- fail-closed deny with reason `config_unavailable`, which is indistinguishable
108
- from a rule denial. A gate mounted before config resolution rendered its paywall
109
- and never re-evaluated, hiding a feature the user had paid for.
110
-
111
- The entitlement path now takes the same two-state split:
112
-
113
- | state | when | behaviour |
114
- |---|---|---|
115
- | **transient** | a Playbook load is in flight (`getPlaybookLoadState() === 'loading'`) | `checkEntitlement` waits for it (bounded, 4s) and re-evaluates. If the load outruns that bound, `EntitlementGate` **parks** the deny instead of publishing it — `result` stays `null`, `denied` stays `false`, `isLoading` stays `true`, and **no** `gate_evaluated` is emitted — then re-checks when the load settles, at most twice per cycle. |
116
- | **terminal** | no config provider is configured, or the load settled without a config | unchanged: fail-CLOSED deny, reason `config_unavailable` in Server mode / `entitlement_not_in_playbook` in local mode, with its `resolution_failure` diagnostic and exactly one `gate_evaluated` carrying the verdict (and its `rule_handle`). |
117
-
118
- The emission rule is the one worth stating plainly: **exactly one
119
- `gate_evaluated` per settled verdict, and none for the transient state** — a
120
- lost race is not an evaluation and must not enter the gate funnel as a denial.
121
-
122
- **No API, wire or reason-code change.** `@public` signatures are unchanged
123
- (`web-sdk/generated/public-api.json` is untouched), both reason codes keep their
124
- meanings, and `tests/reason-contract.json` is unchanged. A `limited`-but-allowed
125
- result is untouched; the fail-closed contract for terminal unavailability is
126
- untouched.
127
-
128
- **Python and Rust are unaffected by design**, for the same reason as BL-0177:
129
- both take the Playbook as a required constructor argument, do no I/O, and have no
130
- not-yet-loaded window.
131
-
132
- **Landed in.** `0.11.3` (BL-0179, #529).
133
-
134
- **Fail-closed in.** Not applicable — terminal behaviour is unchanged; only the
135
- transient race is now absorbed.
136
-
137
- **Proving test.** `web-sdk/react/useCan.config-race.test.tsx` (a gate mounted
138
- mid-race ends on the rule's verdict, allow and deny) and
139
- `web-sdk/entitlement-config-race.test.ts` (both states, the emission rule, and
140
- the bounded post-bound retry for `PlacementController` and `EntitlementGate`,
141
- reached by injecting a `0` wait bound rather than with fake timers).
142
-
143
- ---
144
-
145
- ### A slot no longer paints its fallback forever when it loses the cold-start config race (BL-0177)
146
-
147
- **What changed.** `getPlacementDecision` returns `config_unavailable` when the
148
- Playbook has not arrived, uncached, specifically so a retry can succeed — but
149
- nothing retried. `useSurfaceSlot` / `FixedSurfaceSlot` decide once per mount, so
150
- on a cold `revturbine_server` load, whenever the first decision beat the two-hop
151
- bootstrap → `/api/sdk/config` chain, the slot rendered its `fallback`
152
- permanently and every integration had to hand-roll a retry.
153
-
154
- `config_unavailable` now has two distinct states and the SDK handles each:
155
-
156
- | state | when | behaviour |
157
- |---|---|---|
158
- | **transient** | a Playbook load is in flight | `getPlacementDecision` waits for it (bounded, 4s) and re-resolves. If the load outruns that bound, `PlacementController` re-decides when it settles — at most twice per load cycle. The slot stays in `isLoading` meanwhile and emits **no** `placement_resolved` / `slot_empty`: a lost race is not a resolution and must not enter the funnel as one. |
159
- | **terminal** | no config provider is configured, or the load settled without a config | unchanged from before: the decision is `config_unavailable`, `visible: false`, uncached, with the resolution-failure diagnostic and the lifecycle + slot events. Bounded retries mean it settles rather than spinning. |
160
-
161
- **No API, wire or reason-code change.** `config_unavailable` is still the reason
162
- code, the decision shape is untouched, and `tests/reason-contract.json` is
163
- unchanged. Customer code that already hand-rolls a retry keeps working — it is
164
- now redundant, not wrong.
165
-
166
- **Python and Rust are unaffected by design.** Both ports take the Playbook as a
167
- required constructor argument and raise on a missing or malformed one
168
- (`server-python/src/revturbine/sdk.py` `__init__`, `server-rust/src/sdk.rs`
169
- `new`), perform no I/O, and never emit `config_unavailable` — there is no
170
- not-yet-loaded window to retry. This is a browser/hosted-mode state only.
171
-
172
- **Landed in.** `0.11.3` (BL-0177, #528).
173
-
174
- **Fail-closed in.** Not applicable — the terminal behaviour is unchanged; only
175
- the transient race is now absorbed.
176
-
177
- **Proving test.** `web-sdk/placements/FixedSurfaceSlot.config-race.test.tsx`
178
- (both states), plus `e2e/journey.transport.spec.ts`, whose two hand-rolled retry
179
- loops were deleted — a retry loop reappearing there is the regression signal.
180
-
181
- ---
182
-
183
- ## 0.11.1
184
-
185
- ### The generated schema *types* gained their `Playbook*` names (BL-0165)
186
-
187
- **What changed.** `0.11.0` renamed every option, keyword and method that carries a
188
- Playbook. It did not rename the **generated type identifiers**, which come from
189
- scaffold and are vendored here — so a `0.11.0` integration still had to import
190
- `ExportedConfigSegmentsItem` to name a segment. Those types now have `Playbook*`
191
- spellings too.
192
-
193
- | deprecated | canonical |
194
- |---|---|
195
- | `ExportedConfigSegmentsItem` | `PlaybookSegmentsItem` |
196
- | `ExportedConfigSegmentsItemPredicatesItem` | `PlaybookSegmentsItemPredicatesItem` |
197
- | `ExportedConfigPlacementItem` | `PlaybookPlacementItem` |
198
- | `ExportedConfigUiPathActionType` | `PlaybookUiPathActionType` |
199
- | `ExportedConfig` | `Playbook` (already shipped in `0.11.0`) |
200
-
201
- **This renames nothing on the wire.** The names are generated from exported keys
202
- of scaffold's Zod barrel: both spellings resolve to the **same schema object**, so
203
- no payload field, default or validation rule differs between them, and the OpenAPI
204
- component names are unchanged (they come from `.meta({ id })` on the underlying
205
- schemas, not from the key). A Playbook written by an older SDK parses byte-for-byte
206
- identically. Scaffold's payload contract — `bundle_schema_version` /
207
- `bundle_min_readable_schema_version` — is untouched, so there is no minimum-reader
208
- floor to raise.
209
-
210
- **The aliases are duplicate definitions, not type aliases.** Scaffold's generators
211
- emit one full TS type, Pydantic model and serde struct per barrel key rather than an
212
- alias, so in Python (`revturbine.types`) and Rust (`revturbine::types`) the old
213
- names remain as their own complete models/structs, generated from the same schema.
214
- No hand-written shim exists in either port, and none is wanted: it would collide
215
- with the generated definition. In TypeScript the `core` barrel re-exports the old
216
- pair with `@deprecated` TSDoc.
217
-
218
- Requires `@revt-eng/schema` / `@revt-eng/core` ≥ 0.1.335, which added the
219
- `Playbook*` keys upstream (scaffold #387).
220
-
221
- Ruling: Kent, 2026-09-23 (BL-0156 — `ExportedConfig` naming deprecated, Playbook
222
- canonical).
223
-
224
- **Landed in** `0.11.1` (additive — every old name still resolves).
225
- **Fail-closed in** `0.12.0`, when BL-0167 removes the `ExportedConfig*` keys from
226
- scaffold's barrel and the generated definitions disappear from the vendored types
227
- along with them. That is the same window as the `0.11.0` option/method aliases, so
228
- an integration has one removal to absorb, not two.
229
-
230
- **Proving test:** scaffold's `src/core/zod/playbook-generated-names.test.ts` (each
231
- `Playbook*` key is the same object as its `RevTurbineConfig*` and `ExportedConfig*`
232
- counterparts; a legacy `export-config.json` payload parses to an equal result
233
- through both spellings of the config schema), plus this repo's
234
- `scripts/check-vendored-types.mjs` (the vendored py/rs copies agree with the pin).
235
-
236
- **Public-API snapshot: unchanged.** `pnpm check:public-api` still reports the same
237
- **62** `@public` exports and `web-sdk/generated/public-api.json` is byte-identical,
238
- because the `core` barrel's type re-exports carry no `@public` tag. Recorded here
239
- rather than left implicit: a rename touching the SDK's type vocabulary that moves
240
- *no* snapshot entry is worth stating, so a reader does not go looking for the diff.
241
- No existing export's signature changed and none was removed.
242
-
243
- ## 0.11.0
244
-
245
- ### `Playbook` is the canonical name for every option that carries one (BL-0156)
246
-
247
- **What changed.** `ExportedConfig` is dead vocabulary. Plan 118 renamed the
248
- domain object to **Playbook** and plan 104 renamed the schema type to
249
- `RevTurbineConfig`, but the *option*, *keyword* and *method* names that carry a
250
- Playbook around the SDK still spelled it `exportedConfig` / `exported_config`.
251
- Every one of them now has a `Playbook`-named counterpart; every old name stays
252
- as a deprecated alias that still works.
253
-
254
- TypeScript:
255
-
256
- | deprecated | canonical |
257
- |---|---|
258
- | `localRuntime.exportedConfig` | `localRuntime.playbook` (already shipped; see below) |
259
- | `localRuntime.resolvers.resolveExportedConfig` | `localRuntime.resolvers.resolvePlaybook` |
260
- | `configProvider.getExportedConfig()` | `configProvider.getPlaybook()` |
261
- | `sdk.getExportedConfig()` | `sdk.getPlaybook()` |
262
- | `getPolicy().exportedConfigVersion` | `getPolicy().playbookVersion` |
263
- | `BrowserRuntimeOptions.exportedConfig` | `BrowserRuntimeOptions.playbook` |
264
- | `LocalEvaluationServerOptions.exportedConfig` | `LocalEvaluationServerOptions.playbook` |
265
- | `ExportedConfigProvider` (type) | `RevTurbineConfigProvider`, also exported as `PlaybookProvider` |
266
- | `ExportedConfig` (type) | `Playbook` |
267
-
268
- Python: `RevTurbineCustomerSdk(exported_config=…)`, `LocalRuntime(exported_config=…)`,
269
- `LocalRuntime.get_exported_config()`, `create_static_placement_resolver(exported_config=…)`,
270
- `derive_local_entitlement_from_configured_rules(exported_config=…)`,
271
- `configured_plan_name_from_exported_config`, `parse_exported_config_or_throw` and
272
- `static.ExportedConfig` all gained `playbook`-spelled counterparts.
273
-
274
- Rust: `configured_plan_name_from_exported_config` is now
275
- `configured_plan_name_from_playbook`, with the old name kept as the crate's
276
- first `#[deprecated]` item. Rust has no keyword arguments, so nothing else in
277
- that port was a caller-visible name.
278
-
279
- `RevTurbineConfigProvider`'s two accessors are both OPTIONAL on the interface so
280
- that an existing `implements RevTurbineConfigProvider` clause keeps compiling;
281
- the `configProvider` option intersects it with a union that still requires
282
- exactly one of them, so a provider implementing neither is a compile error where
283
- it is passed.
284
-
285
- Reading a deprecated name logs **one** development-build warning per runtime
286
- (one `DeprecationWarning` per process on Python) naming the canonical
287
- replacement — one flag for every alias, so an integration still spelling several
288
- of them gets a single line, not a wall. Production builds are silent. Requires
289
- `@revt-eng/core` ≥ 0.1.331, which made the same rename upstream (scaffold #380).
290
-
291
- Ruling: Kent, 2026-09-23 (BL-0156).
292
-
293
- **Landed in** `0.11.0`. **Fail-closed in** `0.12.0` for the `ExportedConfig`
294
- aliases — until then every old name works and warns once.
295
-
296
- **Proving test:** `web-sdk/playbook-option.test.ts` (canonical never warns, the
297
- alias still resolves, one warning across three read sites, both spellings reach
298
- the same Playbook at every public read site),
299
- `server-python/tests/test_playbook_option.py` (the same contract plus
300
- `get_exported_config()`), and `server-rust/src/user_context.rs`
301
- `playbook_rename_tests` (the alias returns exactly what the canonical returns).
302
-
303
- ### `localRuntime.playbook` is the canonical local-mode config key
304
-
305
- **What changed.** The record this file owed and never carried: `localRuntime.playbook`
306
- shipped earlier as the canonical spelling of `localRuntime.exportedConfig`, with
307
- `resolveLocalPlaybook()` as the single resolver deciding precedence, but no
308
- changelog entry was ever written for it — so an integration could not date the
309
- change. It is recorded here rather than back-dated, because the version it
310
- landed in is not the version this entry appears in and pretending otherwise is
311
- exactly the confusion the "Landed in" / "Fail-closed in" split exists to
312
- prevent. As of `0.11.0` the alias also warns once (it did not before).
313
-
314
- **Landed in** a release before `0.11.0` (additive; the alias never stopped
315
- working). **Fail-closed in** `0.12.0`, with the rest of the `ExportedConfig`
316
- aliases.
317
-
318
- **Proving test:** `web-sdk/playbook-option.test.ts` — `resolveLocalPlaybook`
319
- accepts either key, prefers `playbook`, and warns only for the alias.
320
-
321
- ### `publicKey` is the only browser credential; `ingestPublicKey` is gone (BL-0113)
322
-
323
- **What changed.** `0.10.0` made `publicKey` the browser credential and kept
324
- `apiKey` and `ingestPublicKey` working as aliases "for one minor". This is that
325
- minor:
326
-
327
- - **`ingestPublicKey` is removed from `RevTurbineInitOptions`.** Passing it is
328
- now a **type error**, including when the options are built in a variable
329
- (`ExactInitOptions` rejects it there too).
330
- - **`apiKey` is no longer read as a browser credential.** It still exists, and
331
- still means exactly one thing: the secret **server key**, for
332
- `@revturbine/sdk/server` and for the headless SDK on a backend. A browser init
333
- that supplies only `apiKey` now resolves **no** browser credential and fails
334
- at init, instead of silently sending a server key as the bearer.
335
-
336
- `resolveBrowserPublicKey()` reads `publicKey` and nothing else, and
337
- `resetBrowserKeyAliasWarning()` is gone with the warning it reset. Keyless
338
- local-only init is unchanged, and the plan 95 anonymous `sdk_init` beacon now
339
- keys off `publicKey` alone.
340
-
341
- Ruling: Kent, 2026-09-23 (BL-0113), closing the window plan 257 opened.
342
-
343
- **Landed in** `0.11.0`. **Fail-closed in** `0.11.0` — the same release. This IS
344
- the fail-closed half of the `0.10.0` entry below; there is no further tolerance
345
- window.
346
-
347
- **Proving test:** `web-sdk/public-key-option.test.ts` (`publicKey` is the bearer
348
- on ingest and every control-plane fetch; `apiKey` resolves nothing; nothing
349
- warns), `web-sdk/customer-side-ingest.test.ts` (the bearer no longer carries the
350
- server key), and `web-sdk/init-options-exactness.test-d.ts` (`ingestPublicKey`
351
- is a type error inline AND in a variable — if the key is ever re-added, `tsc`
352
- fails on the unused `@ts-expect-error`).
353
-
354
- ---
355
-
356
- ## 0.10.10
357
-
358
- ### Trial tokens now reach placement content, not only `getPersonalizationTokens()` (BL-0169)
359
-
360
- **What changed.** A placement whose copy authors `{{trial_days_remaining}}` or
361
- `{{trial_days_total}}` now renders the live values. Content interpolation sources
362
- its token map from the **output content itself**, so a provider-derived token
363
- only reaches the copy if the resolver writes it onto that content first. The
364
- usage lane always did (`usage_current`, `usage_limit`, `usage_percent`,
365
- `usage_remaining`, `reset_date`); the trial lane never did, so a `trial_ending`
366
- body reading `"{{trial_days_remaining}} days left"` shipped the literal
367
- `{{trial_days_remaining}}` to the end user — on every port. The two names were
368
- derived for `getPersonalizationTokens()` all along, which is why the gap survived:
369
- a host that read the token map saw the right numbers and a host that authored the
370
- token into copy did not.
371
-
372
- | | before | now |
373
- |---|---|---|
374
- | `getPersonalizationTokens().trial_days_remaining` | live value | live value (unchanged) |
375
- | content `{{trial_days_remaining}}` / `{{trial_days_total}}` | literal `{{…}}` | live value |
376
- | `outputContent.trial_days_remaining` / `_total` | absent | written when the plan provider carries a finite number |
377
-
378
- Identical on all three ports (`ts:local-resolver.ts`,
379
- `py:core/placements/local_resolver.py`, `rs:placements/static_resolver.rs`): the
380
- same two token names, a `Number.isFinite` guard, provider state winning over an
381
- authored content value of the same key, and the value passed through **without
382
- widening** — `day_number` 7 + `days_remaining` 3 is `trial_days_total` `10`, never
383
- `10.0` (BL-0155).
384
-
385
- **Who this reaches.** Any host whose placement copy authors either token. Copy
386
- that hard-coded one of those keys as a decorative literal now has it overwritten
387
- by live state — the same precedence the usage lane and
388
- `derivePlacementPersonalizationTokens` have always had. `{{trial_plan_name}}` and
389
- `{{trial_features_used}}` remain **not yet wired** by the placement-studio-ui
390
- spec's own note and are untouched.
391
-
392
- **Landed in.** `0.10.10`.
393
-
394
- **Fail-closed in.** `0.10.10` — absence still leaves the raw token standing
395
- rather than rendering `0`, so a host with no trial provider state sees exactly
396
- what it saw before.
397
-
398
- **Proving test.** Parity scenario `trial_tokens_in_content` under
399
- `"normalize": "preserve-representation"` (byte-locked ts ≡ py ≡ rs), plus
400
- `py:tests/placements/test_local_resolver.py` and `rs:tests/static_resolver.rs`
401
- `trial_tokens_are_injected_from_plan_provider_state` and its two neighbours,
402
- mirroring the scaffold-side `local-resolver.test.ts` cases. Needs
403
- `@revt-eng/core` 0.1.331 or later (scaffold #382) for the TS half; this release
404
- pins 0.1.332.
405
-
406
- ---
407
-
408
- ## 0.10.9
409
-
410
- ### The trial-status overlay no longer changes a number's type (BL-0155)
411
-
412
- **What changed.** The `UserTrialStatus` → `trial_*` PlanProviderState overlay now
413
- passes each numeric field through on every port, instead of two ports widening
414
- it to a float. The canonical behaviour is the TS SDK's
415
- `synthesizeProviderContext` (`web-sdk/customer-side.ts`, the `planTrialFields`
416
- block), which spreads every `UserTrialStatus` member verbatim: an integer
417
- `progress_percent` stays an integer on the provider state, and
418
- `trial_days_total` is `day_number + days_remaining` in the inputs' own kind, so
419
- `7 + 3` is `14`. The two server ports diverged from it:
420
-
421
- | field | Python before | Rust before | all three now |
422
- |---|---|---|---|
423
- | `progress_percent` → `trial_progress_percent` | `float(v)` | verbatim | verbatim |
424
- | `days_remaining` → `trial_days_remaining` | `float(v)` | verbatim | verbatim |
425
- | `usage_consumed` → `trial_usage_consumed` | `float(v)` | verbatim | verbatim |
426
- | `usage_limit` → `trial_usage_limit` | `float(v)` | verbatim | verbatim |
427
- | `in_trial` → `trial_active` | `bool(v)` | verbatim | verbatim |
428
- | derived `trial_days_total` | `float(a) + float(b)` | `f64` sum | `int + int` → `int`; any fractional half → float |
429
-
430
- **Who this reaches.** Only a host that reads the provider state it built —
431
- `revturbine::overlay_trial_status_on_plan_provider` on Rust, or the merged
432
- `PlanProviderState` on Python — and cares whether it holds `70` or `70.0`
433
- (serializing it, comparing it to an integer, or logging it). No decision
434
- changes: every reader in the trial-gating layer widens on read, which is exactly
435
- why the divergence survived. A non-numeric `day_number`/`days_remaining` half
436
- now derives no total on Python instead of raising, matching Rust's existing
437
- numeric guard.
438
-
439
- **Landed in.** `0.10.9`.
440
-
441
- **Fail-closed in.** `0.10.9` — there was no tolerated-old-shape window; the
442
- representation simply changes.
443
-
444
- **Proving test.**
445
- `server-python/tests/test_trial_overlay_upsert.py::test_overlay_preserves_integer_numeric_representation`
446
- and `server-rust/src/sdk.rs::overlay_preserves_integer_numeric_representation`
447
- — both assert the *type*, not just the value, because `100 == 100.0` in Python.
448
- Scenario `trial_overlay_integer_fields` locks that the three ports still decide
449
- identically from an all-integer trial status.
450
-
451
- > **Correction, 2026-09-23 (BL-0158, harness-only — no release).** This entry
452
- > originally said the parity corpus *cannot* see this class of divergence,
453
- > because `tests/parity/normalize.*` rule 4 collapses integral floats by design
454
- > and nothing in the corpus returned the overlaid provider state. Both halves
455
- > are now closed and the sentence no longer holds:
456
- > `trial_overlay_integer_fields` drives `resolveProviders` (already shipped on
457
- > all three runtimes) under a new per-scenario
458
- > `"normalize": "preserve-representation"` flag that turns the collapse off, so
459
- > `14` and `14.0` are different bytes and the cross-language byte-diff fails on
460
- > a widened field. No public API changed; the harness gained the ability to see
461
- > provider state.
462
-
463
- ---
464
-
465
- ## 0.10.8
466
-
467
- ### `{{recommended_plan_name}}` and `{{plan_name}}` no longer reach end users as raw tokens (BL-0121)
468
-
469
- **What changed.** The placement-decision lane now substitutes the five tokens
470
- the SDK resolves from the Playbook — `plan_name`, `plan_price`,
471
- `upgrade_plan_price`, `recommended_plan_handle`, `recommended_plan_name` —
472
- into `RevTurbinePlacementDecision.content` (and the mirrored
473
- `decision.output.content`). It previously substituted `plan_price` and
474
- `upgrade_plan_price` only.
475
-
476
- `recommended_plan_handle` / `recommended_plan_name` were already derived, by
477
- the parity-locked `resolveRecommendedPlanTokens` dispatch, and already readable
478
- via `getPersonalizationTokens()`. Nothing wrote them into rendered content, so
479
- a placement authored with `"Upgrade to {{recommended_plan_name}}"` shipped the
480
- literal braces to the end user. Observed on the CybeDefend demo, 2026-09-22.
481
-
482
- Two properties of the substitution are deliberate:
483
-
484
- | input | result |
485
- |---|---|
486
- | a token the SDK owns but cannot resolve (top-of-ladder user has no next plan) | empty string — the spec's documented empty-token convention |
487
- | a token the SDK does not own (`{{usage_percent}}`, an app-defined token) | left verbatim, so the React render lane still resolves it |
488
-
489
- `plan_name` resolves through the plan's `unique_handle`, the matching identity
490
- — the lookup used to be handed the plan *object*, which by design resolves
491
- nothing, so `{{plan_name}}` rendered raw for every user identified by
492
- `plan_handle`.
493
-
494
- **Landed in.** `0.10.8`.
495
-
496
- **Not fixed here.** `{{upgrade_plan_price}}` still renders the ANNUAL amount
497
- for a plan that has both an annual and a monthly variation. Variation
498
- preference keys off the user's billing cadence, but no supported input carries
499
- it (`billing_period` is absent from `UserContextSchema` and from the recognized
500
- `identify()` / `update()` keys), so selection falls through to the
501
- alphabetically-first variation and `<plan>_annual` always wins. Closing it
502
- needs a schema field for the cadence and a contract for which period the token
503
- reflects when the cadence is unknown; both are open on BL-0121.
504
-
505
- **Proving test.** `web-sdk/customer-side-upgrade-tokens.test.ts`.
506
-
507
- ---
508
-
509
- ## 0.10.7
510
-
511
- ### The Python and Rust ports stop filtering payloads on `status` (BL-0151)
512
-
513
- **What changed.** Payload `status` is no longer a runtime predicate in any port.
514
- Python and Rust required `status == "active"` on a placement payload before it
515
- could become a candidate, and read a `status` off each content-linked studio
516
- payload before overlaying its copy. Both now ignore it, matching the TypeScript
517
- port, which never gated on it.
518
-
519
- | | Before | After |
520
- |---|---|---|
521
- | Placement payload candidacy (Python, Rust) | required `status == "active"` | every payload, status ignored |
522
- | Content-linked copy overlay (Python, Rust) | required the studio payload's `status` to read `active` | always overlaid |
523
- | TypeScript | already ignored `status` | unchanged |
524
-
525
- **Why it mattered.** `status` is not a field of the exported Playbook.
526
- `RevTurbineConfigStudioPayload` and `RevTurbineConfigPlacementPayloadItem` carry
527
- no `status` key, unknown keys are stripped on parse, and the published JSON
528
- Schema is `additionalProperties: false` — because runtime status is *derived*
529
- control-plane side and the stored column was dropped. So `status == "active"` was
530
- false for **every** payload of a real Playbook: the Python and Rust resolvers
531
- indexed no candidates at all and returned `placement_not_found`, and their
532
- content-lookup adapters dropped every content-linked payload, keeping the inline
533
- copy where TypeScript overlaid the linked block. A config whose first payload
534
- carried a stray authored `status` also decided differently across ports.
535
-
536
- The cross-language parity gate could not see any of this: the only fixtures
537
- reaching these paths hand-write `status` on each payload — a key the schema would
538
- strip — so the ports were compared on a shape no Playbook has.
539
-
540
- **Landed in.** 0.10.7 (`server-python`, `server-rust`). No `@revt-eng/core`
541
- change rides with it: TypeScript was already correct, so there is no scaffold
542
- release and no pin bump.
543
-
544
- **Fail-closed in.** n/a — this release removes a fail-*closed* filter. Python and
545
- Rust consumers on a real Playbook go from no decision to the decision
546
- TypeScript has always returned.
547
-
548
- **Proving test.** `tests/parity/fixtures/payload_status_filter.json` — two lanes:
549
- a stray authored `status` that disagrees with drag order (payload 1 `draft`,
550
- payload 2 `active`; payload 1 must still win), and the real wire shape with no
551
- `status` anywhere plus a content-linked overlay. Mutation-checked by reinstating
552
- the Python filter, which diverges on the first call. Plus
553
- `server-python/tests/placements/test_local_resolver.py`,
554
- `test_json_content_provider.py` and `server-rust/tests/static_resolver.rs`, each
555
- covering both the stray-value and the no-key case.
556
-
557
- **Who is affected.** Every `revturbine` (PyPI) and `revturbine` (crates.io)
558
- consumer resolving placements from a schema-valid exported Playbook — that is,
559
- one produced by the control plane rather than hand-written with a `status` field.
560
- Those integrations were receiving no placement decisions at all.
561
-
562
- ---
563
-
564
- ## 0.10.6
565
-
566
- ### The trial-status PlanProvider overlay ships in the Rust crate (BL-0153)
567
-
568
- **What changed.** `revturbine::overlay_trial_status_on_plan_provider` is a new
569
- public function on the Rust crate: it maps a runtime `UserTrialStatus` onto the
570
- `trial_*` fields of a resolved PlanProviderState, the fields the placement
571
- resolver's `trial_progress` / `trial_ending` / `trial_ended` /
572
- `trial_converted` gates and milestone supersession read. Python has always done
573
- this inside its shipped package
574
- (`revturbine.sdk._overlay_trial_status_on_plan_provider`); on Rust the mapping
575
- existed only as a private helper the facade used, so a host that assembles its
576
- own provider context — including this repo's own parity runner — had to
577
- re-implement it. Additive: no existing signature changed.
578
-
579
- Porting Python's mapping faithfully corrected two Rust-only divergences in the
580
- overlay the facade applies:
581
-
582
- | `UserTrialStatus` field | Rust before | Rust now (= TS/Python) |
583
- |---|---|---|
584
- | `day_number` + `days_remaining` | not derived | `trial_days_total = day_number + days_remaining`, only when both are present |
585
- | `day_number` | written to `trial_day_number` | not written — no provider-state field reads it |
586
- | `usage_entitlement_handle` | dropped | `trial_usage_entitlement_handle` |
587
-
588
- `trial_days_total` is the input to the time-mode progress fallback in
589
- `placements::trial_gating`, so before this the fallback could never fire on the
590
- Rust port.
591
-
592
- **Landed in.** `0.10.6`.
593
-
594
- **Fail-closed in.** `0.10.6` — the parity facade-presence gate
595
- (`tests/parity/facade-surface.json`) no longer allow-lists a runner-local
596
- overlay, so a future re-implementation harness-side fails the gate.
597
-
598
- **Proving test.** `server-rust/src/sdk.rs` `overlay_maps_every_canonical_trial_field`,
599
- `trial_days_total_requires_both_halves`, `overlay_does_not_clobber_base_state_with_null`
600
- (mirroring `server-python/tests/test_trial_overlay_upsert.py`), plus the
601
- `trial_ending_days_before_end`, `trial_ended_post_expiry` and
602
- `trial_progress_milestone_supersession` parity fixtures.
603
-
604
- ---
605
-
606
- ## 0.10.5
607
-
608
- ### Trial-only local integrations get provider context (BL-0120)
609
-
610
- **What changed.** `synthesizeProviderContext()` — the fallback that builds
611
- `DomainProvider` state from `userContext` when no explicit domain provider is
612
- registered — dropped an integration's trial data whenever no commercial
613
- `plan` / `plan_handle` was also present. An app supplying **only**
614
- `initialData.trialStatus` (or `setTrialInstances()` / `setTrialStatus()` with
615
- no plan) got no provider context at all: `providers.plan` came back
616
- `undefined`, so `{{trial_days_remaining}}` (and every other `trial*` token
617
- `derivePlacementPersonalizationTokens` derives from `providers.plan`) stayed
618
- raw, unresolved, in placement copy. Reported against the CybeDefend demo
619
- (SDK 0.7.13): a `trial_ending` placement with `in_trial: true,
620
- days_remaining: 3` left `{{trial_days_remaining}}` literal in the rendered
621
- body.
622
-
623
- Two omissions, same root cause — trial was never checked alongside
624
- `plan` / `plan_handle` / `usage` / `tiers` / `experiments`:
625
-
626
- - the early-return guard (`if (!plan && !planHandle && !usage && !hasTiers
627
- && !hasExperiments) return undefined;`) treated a trial-only integration as
628
- having no signal whatsoever;
629
- - even past that guard, the returned `plan` key itself was gated on
630
- `plan || planHandle` — so the trial fields (`trialActive`,
631
- `trialDaysRemaining`, etc.) it computed were still discarded for a
632
- plan-less trial.
633
-
634
- Both gates now also check `hasTrial` (an explicit trial signal — the default
635
- untouched `{ in_trial: false }` sentinel does not count, so the omitted-signal
636
- short-circuit is otherwise unchanged for integrations that supply nothing at
637
- all). `usage`-only, `tiers`-only, and `experiments`-only integrations already
638
- threaded through correctly before this change; trial was the only signal
639
- missing from both checks.
640
-
641
- No public API change — `synthesizeProviderContext` is private, and the fix is
642
- additive: a plan-less trial integration now gets a `providers.plan` it never
643
- got before, with an empty `currentPlanHandle: ''` (no plan name/handle was
644
- ever supplied to derive one from).
645
-
646
- **Landed in** `0.10.5`. **Fail-closed in** n/a — a previously-dropped signal
647
- is now included; nothing that resolved before stops resolving.
648
-
649
- **Proving test:** `web-sdk/customer-side-trial-token-signal.test.ts` — a
650
- trial-only local integration now gets a non-empty provider context with
651
- `trialActive`/`trialDaysRemaining` set, and feeding those through
652
- `derivePlacementPersonalizationTokens` + `resolveContent` renders
653
- `{{trial_days_remaining}}` as `"3"` instead of leaving it literal. Includes
654
- the positive control (trial + plan together — unchanged), the negative
655
- control (no trial data at all — the token stays absent, never coerced to
656
- `"0"`), and a sibling check confirming usage-only integrations were already
657
- unaffected by the guard.
658
-
659
- ---
660
-
661
- ## 0.10.4
662
-
663
- ### Every payload is a selection candidate, not just the first (BL-0122)
664
-
665
- **What changed.** A placement's payloads are now *all* candidates on both
666
- selection paths, in all three ports. Previously each port considered exactly one
667
- payload per placement — TypeScript took `payloads[0]`, Python and Rust the first
668
- payload with `status == "active"` — so payloads 2+ were never candidates and
669
- their `target.segment_chips` could not be evaluated at all.
670
-
671
- | | Before | After |
672
- |---|---|---|
673
- | Candidacy | one payload per placement | every payload (Python/Rust: every `active` payload) |
674
- | `target.segment_chips` on payloads 2+ | never evaluated | evaluated per payload |
675
- | Drag precedence | a pre-filter — it chose the only candidate | a tiebreaker among the payloads the user **matches** |
676
- | Direct lookup by name/id | mapped a name to one payload | maps a name to every payload, gated individually, first eligible wins |
677
-
678
- The contract this restores is
679
- [`placement-prioritization.md`](https://github.com/revt-eng/revturbine-devkit/blob/main/docs/specs/scaffold/placement-prioritization.md)
680
- §1 stage 3 — "Targeting — the user's plan and segment match **a payload**" — with
681
- §4 and Appendix D scoping drag precedence to payloads that are equally eligible.
682
-
683
- **Why it mattered.** A placement holding an admin payload and a member payload
684
- gave every member either the admin copy (when payload 1 was unchipped) or
685
- nothing at all (when payload 1 was chipped to admins). An integration hit the
686
- second shape on 0.7.13 and concluded config-driven segmentation was inert. Plan
687
- 233 TASK-7 had already made the chip predicate real — but the predicate was only
688
- ever asked about one payload.
689
-
690
- **Landed in.** 0.10.4 (all three ports, plus `@revt-eng/core` 0.1.326).
691
-
692
- **Fail-closed in.** 0.10.4 — the same release. There is no tolerance window:
693
- a user who matches no payload now receives `visible: false` with
694
- `segment_target_mismatch` rather than payload 1's content.
695
-
696
- **Proving test.** `tests/parity/fixtures/segment_chip_payload_selection.json`
697
- (cross-language), plus `local-resolver-payload-selection.test.ts`,
698
- `server-python/tests/placements/test_payload_selection.py` and
699
- `server-rust/tests/payload_selection.rs` — each exercising **both** the slot and
700
- the direct-lookup path, because gating one and not the other is exactly the back
701
- door plans 138 and 233 each had to close.
702
-
703
- **Who is affected.** Any Playbook authoring more than one payload on a
704
- placement where payload 1 is not the payload a given user matches. Those users
705
- now see the payload their chips select — which is the fix, and is a live
706
- behaviour change for such configs. Single-payload placements are unaffected.
707
-
708
- ---
709
-
710
- ## 0.10.3
711
-
712
- ### The Rust port gains the decision surfaces Python already shipped (BL-0145)
713
-
714
- **What changed.** `RevTurbineCustomerSdk` on the Rust port (`revturbine`,
715
- crates.io) now exposes the same decision surfaces the Python port exposes.
716
- Nothing on the TypeScript or Python side changes; this is a Rust-only,
717
- purely additive release.
718
-
719
- | Added | Shape |
720
- |---|---|
721
- | `RevTurbineCustomerSdk::can(handle, context)` | The advertised alias of `check_entitlement`, matching the scaffold SDK function surface (canonical `checkEntitlement`, alias `can`). |
722
- | `RevTurbineCustomerSdk::get_eligible_plans()` | `Vec<EligiblePlan>` — public, segment-eligible plan variations. |
723
- | `RevTurbineCustomerSdk::get_eligible_addons()` | `Vec<EligibleAddon>` — the add-on twin. |
724
- | `RevTurbineCustomerSdk::evaluate_trial_status(instances, now_iso, base_plan_handle, usage_balances)` | `TrialEvaluation`, reading `free_trial_rules` / `reverse_trial_rules` from the constructed Playbook. |
725
- | `revturbine::format_currency_minor_units(amount, currency, locale)` | Free function, because Python exposes it as a module function. |
726
- | `revturbine::plans` | New module carrying the catalog eligibility port and the formatter. |
727
- | `UserContext::segment_ids` | Pre-resolved segment ids the catalog methods match against. |
728
-
729
- `UserContext` gains a field but derives `Default`, so existing construction
730
- with `..Default::default()` keeps compiling.
731
-
732
- **Why it was invisible.** The cross-language parity gate was green on the
733
- catalog and currency scenarios only because the Rust parity runner
734
- *reimplemented* `eligible_catalog` and `format_currency_minor_units` inline
735
- rather than calling the crate — so the comparison never touched shipped code,
736
- and the crate could lack the capability entirely without a single fixture
737
- going red. The runner now calls `revturbine::plans`, and the inline copies are
738
- deleted; all 102 comparisons stay byte-identical.
739
-
740
- ---
741
-
742
- ## 0.10.2
743
-
744
- ### Local mode resolves placements by slot id (BL-0119)
745
-
746
- **What changed.** In `local_only` mode the browser SDK now resolves a placement
747
- request against the Playbook's authored `placement_slots[]` registry.
748
- `getPlacement({ slotId })` — with or without a `componentType` — previously
749
- returned `null` for a slot the Playbook declared, and a controller/`usePlacement`
750
- mount of that slot resolved to `placement_not_found`. Looking the same placement
751
- up by **name** worked, which is what made this look like a config problem rather
752
- than an SDK one.
753
-
754
- Two things were missing, and both are now in place:
755
-
756
- - **`registerSurfaceSlot()` adopts the declared template.** `surface_template_ids`
757
- on the registered record is what puts the shared resolver on its slot branch,
758
- where `trigger.slot_id` is matched. Without it the resolver fell back to direct
759
- lookup, which is keyed by placement **name**/id and therefore can never match a
760
- slot id — hence `placement_not_found`. An id passed explicitly at the call site
761
- still wins; the mounting code knows what it renders.
762
- - **`getPlacement()` falls through to the slot registry.** The local placement
763
- cache only holds slots a decision has already run through, so a cold lookup
764
- found nothing and stopped. It now derives the record from `placement_slots`,
765
- matching on `id` and falling back to `surface_type` when only a component type
766
- is given — the same derivation scaffold's headless
767
- `LocalRuntime.slotRecordForConfig` has always performed. Registration on this
768
- path is local only: reading a placement never writes a surface slot back to the
769
- control plane.
770
-
771
- This closes a browser-versus-headless divergence: the same Playbook decided
772
- differently depending on which runtime read it. No public API change — no
773
- signature moved, and nothing new is asked of the caller. A slot id that no
774
- `placement_slots` entry declares still resolves to `null`, unchanged.
775
-
776
- **Landed in** `0.10.2`. **Fail-closed in** n/a — a previously-`null` lookup now
777
- returns the placement the Playbook authored.
778
-
779
- **Proving test:** `web-sdk/local-slot-id-lookup.test.ts` — by-slot-id and
780
- by-slot-id-plus-component-type both resolve, the controller path no longer
781
- reports `placement_not_found`, an undeclared slot id still returns `null` and
782
- gains no invented template, an explicit `surfaceTemplateIds` still wins, and the
783
- by-name lookup that always worked keeps working (the positive control).
784
-
785
- ---
786
-
787
- ## 0.10.1
788
-
789
- ### Treatment interactions carry the identified `account_id`
790
-
791
- **What changed.** Every treatment interaction the SDK sends to
792
- `/api/events/interactions` — the impression that writes a
793
- `placement_presentations` row, plus dismiss / click / conversion — now carries
794
- `account_id`, taken from the account the integration identified
795
- (`identify(userId, { account_id })` / `setUserContext`). It was never sent at
796
- all, so the ingest route's `account_id ?? user_id` fallback stamped a **user**
797
- id into an **account** column. `placement_presentations.account_id` is a join
798
- key, not a label: `monetization_funnel` matches it against account ids from
799
- `events_clickstream` / `events_billing`, and every experiment summary pipe
800
- reads it when `analysis_unit='account'`. Those joins therefore matched only
801
- where a user id happened to equal an account id — and an account-grain
802
- experiment readout returned the user-grain n while looking perfectly valid.
803
-
804
- Two details make it a usable key. The value is PII-redacted **identically to
805
- `/api/track`**, so an email-shaped account id becomes the same hash in
806
- `placement_presentations` and in `events_clickstream` and the funnel actually
807
- joins. And when no account was identified the field is **omitted**, never set
808
- to the user id — the route keeps its own fallback for SDKs that have not
809
- upgraded, but a wrong join key is worse than a missing one.
810
-
811
- No public API change: nothing new is asked of the caller, and
812
- `RevTurbineTreatmentInteractionInput` is unchanged. Integrations that already
813
- pass `account_id` to `identify()` get correct account-grain analytics with no
814
- code change; integrations that never identify an account are unaffected on the
815
- wire and see the same route-side fallback as before.
816
-
817
- **Landed in** `0.10.1`. **Fail-closed in** n/a — additive; nothing old is
818
- rejected.
819
-
820
- **Proving test:** `web-sdk/interaction-wire-contract.test.ts` — "the account
821
- identity the analytics joins key on": the identified account reaches the wire
822
- distinct from `user_id`, an unidentified one is omitted rather than copied from
823
- `user_id`, an email-shaped account id matches the `/api/track` lane
824
- byte-for-byte, and a re-queued batch keeps the account that was acting when
825
- each interaction happened.
826
-
827
- ---
828
-
829
- ## 0.10.0
830
-
831
- ### `publicKey` is the browser credential; `apiKey` is the server key
832
-
833
- **What changed.** The browser init option for the ingest (public) key is
834
- `publicKey` — on `initRevTurbine`, `<RevTurbineProvider options>`, and the
835
- headless init alike. Every browser bearer (ingest, launched-Playbook delivery,
836
- user context, branding, trial status) uses that one key. `apiKey` now means
837
- one thing everywhere: the secret **server key**, as it always did on
838
- `@revturbine/sdk/server` — pass it from backend code only (a route handler
839
- using `@revturbine/sdk/headless` keeps using `apiKey`). The name states what the
840
- credential is at the call site: a security scanner or an agent that meets
841
- `publicKey` in a bundle knows it belongs there, where `apiKey` reads as a leak.
842
-
843
- `apiKey` and `ingestPublicKey` are still accepted on a browser init as aliases
844
- of `publicKey` for one minor (precedence: `publicKey`, then `ingestPublicKey`,
845
- then `apiKey`). Using an alias without `publicKey` in a browser logs a one-time
846
- development warning naming `publicKey`; production builds are silent. On the
847
- browser `RevTurbineInitOptions` type, `apiKey` is now optional (it was required)
848
- and `ingestPublicKey` is `@deprecated`. Keyless local-only init is unchanged,
849
- and the plan 95 anonymous `sdk_init` beacon still fires only when no public key
850
- (`publicKey` or `ingestPublicKey`) was supplied.
851
-
852
- Ruling: Kent, 2026-09-21, devkit PR #808 (closed).
853
-
854
- **Landed in** `0.10.0`. **Fail-closed in** `0.11.0` — `ingestPublicKey` was
855
- removed from the options type and `apiKey` stopped being read as a browser
856
- credential (BL-0113); see the `0.11.0` entry above.
857
-
858
- **Proving test:** `web-sdk/public-key-option.test.ts` — precedence, the single
859
- bearer across ingest and control-plane fetches, the browser-only warning, and
860
- the keyless local-only init. Type-level: `web-sdk/init-options-exactness.test-d.ts`
861
- accepts `publicKey` and rejects the `publickey` casing typo.
862
-
863
- ### `endpoint` and `mode` are optional on `initRevTurbine` and `<RevTurbineProvider>`
864
-
865
- **What changed.** `RevTurbineInitOptions.endpoint` defaults to
866
- `https://revturbine.com/app` (`DEFAULT_HOSTED_ENDPOINT`, exported) and
867
- `RevTurbineInitOptions.mode` defaults to `'snippet'` (`DEFAULT_SDK_MODE`,
868
- exported); `<RevTurbineProvider>` passes `'react'` when the app does not set it.
869
- Both were required; `mode` only ever labelled telemetry (`page_view.mode` and a
870
- diagnostics message), and every hosted integration used the same endpoint.
871
- Existing calls that pass them are unchanged. Local mode is unchanged (its
872
- placeholder defaults already applied). Additive, no version bump required.
873
-
874
- **Landed in** `0.10.0`. **Fail-closed in** n/a — nothing old is rejected.
875
-
876
- **Proving test:** `web-sdk/public-init.test.ts` — "defaults endpoint and mode
877
- for a hosted init that omits them".
878
-
879
- ### Reason-code compatibility verification
880
-
881
- Added a reviewed baseline for 27 entitlement and 21 placement reason values,
882
- checked against live SDK/core fixtures. Removal/rename controls exercise every
883
- protected value, and baseline changes require this changelog to change through
884
- the existing public-API gate. Custom provider reasons remain extensible and
885
- free-form diagnostics are excluded. This adds verification only; no runtime
886
- reason values or package versions change.
887
-
888
- Proving tests: `web-sdk/reason-contract.test.ts` and
889
- `web-sdk/reason-contract-policy.test.ts`. The intentional-change procedure is
890
- in `docs/reason-code-contract.md`.
891
-
892
- ## 0.9.3
893
-
894
- ### Fixed
895
-
896
- - Placement explanations use the same published segment-eligibility helper as
897
- decisions, keeping OR-within-segments and AND-with-plan behavior aligned.
898
- The explanation/decision matrix covers local and provider-backed Playbooks,
899
- unknown or missing segments, exact handle matching and plan-filter combinations.
900
-
901
- ## 0.9.2
902
-
903
- ### Public initializer user context
904
-
905
- `await initRevTurbine({ user: { id, ...context }, ...options })` from
906
- `@revturbine/sdk` or `@revturbine/sdk/headless` now passes `id` only as the
907
- identity argument. Supported user context retains its existing behavior without
908
- the spurious unrecognized-context-key warning for `id`; genuinely unknown keys
909
- still warn. Public quick starts now show the awaited `SdkSession` and
910
- `session.sdk.getBranding()`. The separate synchronous core initializer is unchanged.
911
-
912
- Proving tests: `web-sdk/public-init.test.ts` and the installed public-package
913
- runtime/type examples in `web-sdk/scripts/check-public-diagnostics.mjs`.
914
-
915
- ## 0.9.1
916
-
917
- ### Public changelog distribution
918
-
919
- The maintained changelog is now included as `CHANGELOG.md` in the npm package
920
- and mirrored at the root of the public SDK repository. The docs Reference
921
- navigation links directly to that authoritative public file. The independent,
922
- hidden docs copy has been retired. The pre-0.3.0 history gap below remains;
923
- this release does not reconstruct it. No SDK runtime behavior changed.
924
-
925
- ## 0.9.0
926
-
927
- ### Placement eligibility follows current context after conversion
928
-
929
- - **What changed** — Conversion remains an analytics event and no longer retires
930
- or temporarily suppresses a placement. Legacy conversion-owned browser state
931
- is ignored. Supply the updated UserContext after a plan change; Playbook
932
- targeting determines whether the offer still applies.
933
- - **What changed** — Fixed and Access Gate placements bypass dismissal, reminder
934
- and bare-click cooldowns. Dismiss and snooze close the current display; the
935
- next explicit trigger, refresh or mount evaluates again. This uses the resolved
936
- placement category, including when another category renders inside a Fixed slot.
937
- Other categories retain authored/default windows, and explicit system
938
- suppression and entitlement denial remain effective.
939
- - **Landed in** — `0.9.0` across JavaScript, Python and Rust.
940
- - **Fail-closed in** — Not applicable; no input shape was removed. Rust callers
941
- constructing `InteractionState` literals should supply the new optional
942
- `explicit_suppressed_until` field or use `..Default::default()`.
943
- - **Proving test** — `web-sdk/conversion-eligibility.test.ts`,
944
- `web-sdk/placements/FixedSurfaceSlot.dismissal.test.tsx`, and the shared
945
- `placement_category_interactions` parity fixture.
946
-
947
- ## 0.8.9
948
-
949
- ### JavaScript: development diagnostics survive package minification
950
-
951
- - **What changed** — The SDK package preserves the environment check until the
952
- consuming application builds it. Previously the minified package baked in
953
- production mode, hiding the React initialization-failure banner, app-theme
954
- override warning and legacy-theme warning even in development applications.
955
- Production applications still suppress those development diagnostics;
956
- `initStatus` and required initialization-error reporting remain available.
957
- The existing fallback for browsers without `process` is preserved.
958
- - **Landed in** — `0.8.9`.
959
- - **Fail-closed in** — Not applicable; no decision or initialization policy changes.
960
- - **Proving test** — `web-sdk/scripts/check-public-diagnostics.mjs` installs the
961
- public tarball and runs Chromium against separate development, production
962
- and environment-preserving consumer bundles. The PR release-build gate
963
- retains the tarball, inventory, SHA-256 and observed diagnostics.
964
-
965
- Python and Rust receive the matching version bump; their behavior is unchanged.
966
-
967
- ## 0.8.8
968
-
969
- Behavioural fixes in Python; a new decision surface in Rust.
970
-
971
- ### Python: numeric coercion unified onto JS Number() semantics
972
-
973
- - **What changed** — `parse_numberish`'s string branch used Python
974
- `float()`, which accepts forms JS `Number()` rejects (underscore
975
- separators: `"1_000"` scored 1000 here, NaN->0 in TypeScript — a
976
- candidate-flipping divergence in every selection scorer) and rejects
977
- forms JS accepts (`"0x10"` is 16). The one JS-semantics parser from the
978
- plan-233 segments port is promoted to `helpers.js_number` and every
979
- coercion site shares it. Ripple alignments: `Number("")` is 0 (the old
980
- is-None assertion pinned the float() behaviour), a whitespace-only
981
- `template_version` resolves to `"0"` exactly as TS does, and
982
- `superseded_versions` no longer fabricates a `"0"` entry from an empty
983
- string (mirrors TS's trim-then-filter).
984
-
985
- ### Rust: the candidate-selection layer, ported
986
-
987
- - **What changed** — `resolve_local_placement_from_candidates` plus the
988
- full helper set (category buckets, plan-53 two-stage tier-3 urgency,
989
- milestone supersession, category conflict suppression, server-order
990
- dominance) now exists in Rust (`placements/selection.rs`). Until now the
991
- Rust port selected by entry order only; competing-category selections
992
- had no third side, which is why plan 234 TASK-15's fixture was deferred.
993
- - **Proving test** — parity fixture `placement_selection_priority`
994
- (10 calls: cross-tier dominance, both tier-3 stages including a
995
- class-vs-proximity disagreement, retention/conversion tie, server_order
996
- skipping conflict suppression, fixed_only, milestone supersession, both
997
- REQ-5 coercion lanes, output_id tiebreak), byte-identical ts/py/rs on
998
- its first regen, plus mirrored port-local suites in Python and Rust.
999
-
1000
- ## 0.8.7
1001
-
1002
- No runtime behaviour change in any port; the release carries new parity
1003
- locks and one serde derive.
1004
-
1005
- ### All ports: trial-status derivation and allocation scoping parity-locked
1006
-
1007
- - **What changed** — two decision surfaces every runtime already evaluated
1008
- gained their first cross-language locks. `evaluateTrialStatus` (the
1009
- free/reverse trial-rule derivation): the TS golden vectors mirrored the
1010
- Python unit suite by hand-maintained convention, and Rust was never in
1011
- the mirror at all; the `trial_status_evaluation` fixture makes the
1012
- agreement a byte-checked property. `computeConsumedPercent` (the spec
1013
- 3.4 Pooling allocation-scoped grant selection): reachable from no
1014
- placement fixture because the static provider has no grants lane; the
1015
- `threshold_allocation_scoping` fixture drives every allocation label
1016
- against a hierarchy whose levels carry DIFFERENT counters.
1017
- - **A wire divergence caught on first regen** — the reverse-trial grants
1018
- set serialized three different ways (TS `JSON.stringify(Set)` = `{}`
1019
- with the contents silently lost; Python's canonicalizer dropped the key;
1020
- Rust emitted the honest list). The runners now own the wire form: a
1021
- sorted array on every side.
1022
- - **Fail-closed in** — no evaluator changed; `TrialEvaluation` gained a
1023
- `Serialize` derive in Rust (additive).
1024
- - **Proving test** — parity fixtures `trial_status_evaluation` (6 calls;
1025
- the usage-lane call was sharpened after the first cut put
1026
- `trial_limit_type` on the RULE and every side agreed on `time` - the
1027
- non-discriminating shape REQ-3 forbids; it rides the INSTANCE) and
1028
- `threshold_allocation_scoping` (9 calls).
1029
-
1030
- ## 0.8.6
1031
-
1032
- One capability lands in the two ports; TypeScript is unchanged and ships this
1033
- version for lockstep alone.
1034
-
1035
- ### Python + Rust: targeting-state derivation ported (buildTargetingState)
1036
-
1037
- - **What changed** — `LocalRuntime.build_targeting_state` raised
1038
- NotImplementedError in Python (a REQ-14 deferral) and had no Rust port at
1039
- all, so the derivation from a raw user context to the traits segment
1040
- evaluation consumes existed only in TypeScript: segment parity proved
1041
- "agrees given the same traits", never "agrees given the same user
1042
- context". Both ports now carry the pure derivation
1043
- (`core.user_context.build_targeting_state` / `user_context.rs`), byte-
1044
- locked against the TS canonical.
1045
- - **Also aligned red-first** — Python's dormant
1046
- `configured_plan_name_from_exported_config` (no callers until now) still
1047
- carried pre-plan-120 semantics: id matching, plan-object resolution, and
1048
- a `_handle` suffix fallback. Plans resolve by `unique_handle` alone; the
1049
- drift-pinning tests were corrected with the alignment.
1050
- - **Fail-closed in** — identity rules are shadow-proof by construction:
1051
- `plan_handle` is a reserved trait a `custom.plan_handle` can never
1052
- impersonate, and no identity means the reserved trait is REMOVED and the
1053
- effective plan omitted.
1054
- - **Proving test** — parity fixture `targeting_state_derivation` (6 calls:
1055
- identity precedence, shadow-proofing, plan-OBJECT fallback, the id that
1056
- must resolve nothing, the no-identity removal, override-wins usage with a
1057
- legacy bare-number entry), byte-identical ts/py/rs, plus the corrected
1058
- unit matrices in both ports.
1059
-
1060
- ## 0.8.5
1061
-
1062
- One behavioural alignment, Python only. TypeScript and Rust are unchanged and
1063
- ship this version for lockstep alone.
1064
-
1065
- ### Python: category buckets and tier-3 urgency aligned to the plan-53 model
1066
-
1067
- - **What changed** — this port's `category_bucket` carried the pre-plan-53
1068
- map for months (trial=3, retention=5 where the canonical folds trial into
1069
- priority tier 3 as bucket 2 and retention into the single discretionary
1070
- bucket 4); its docstring cited source lines that had moved AND changed
1071
- upstream. The map feeds the selection comparator, so a trial and a usage
1072
- placement competing for one surface ordered STRICTLY here (usage always
1073
- first) while the canonical ties them and applies the plan-53 two-stage
1074
- urgency model — which this port also lacked. `tier3_class` is now ported
1075
- and staged ahead of proximity in `resolve_local_placement_from_candidates`,
1076
- the map matches the canonical, and the system-caps exemption boundary moved
1077
- from the compensating `<= 3` to the canonical `<= 2` (the exempted category
1078
- set is unchanged).
1079
- - **Landed in** — `helpers.category_bucket` / `helpers.tier3_class`, the
1080
- comparator in `placement_decision.py`, and the caps exemption boundary.
1081
- - **Fail-closed in** — no gate changes; this is ordering. Exemptions and
1082
- discretionary classification are set-identical before and after.
1083
- - **Proving test** — `tests/placements/test_selection_tier3.py` (class
1084
- ordering with class-vs-proximity DISAGREEMENT cases; mutation-checked:
1085
- disabling the tier3 stage fails exactly the two stage-1 tests), plus the
1086
- bucket-map matrix in `test_helpers.py` whose old strict `usage < trial`
1087
- invariant was pinning the drift. The cross-language fixture for this
1088
- surface lands with the Rust selection-layer port (plan 234 TASK-8).
1089
-
1090
- ## 0.8.4
1091
-
1092
- One behavioural alignment, Python only. TypeScript and Rust are unchanged and
1093
- ship this version for lockstep alone.
1094
-
1095
- ### Python: cap/cooldown maths consolidated onto the shared primitive
1096
-
1097
- - **What changed** — `placement_decision.py` and `cap_enforcer.py` carried
1098
- their own copies of the cap-window and cooldown arithmetic that TypeScript
1099
- consolidated onto `evaluateCaps` (plan 233 TASK-15 / scaffold #351). Both
1100
- now delegate to the new `cap_rules.evaluate_caps` port. Reading the bodies
1101
- side by side surfaced two silent divergences, both aligned to the TS
1102
- canonical: Fixed / Access-Gate categories are now exempt from per-payload
1103
- caps in `check_placement_caps` (TS has exempted them since plan 167; this
1104
- port capped them), and a cap deny now persists the UNFILTERED state — the
1105
- old bodies trimmed `seen_at` to the tripping window (one comment claimed
1106
- "Mirrors TS"; TS does no such trim), silently shrinking future week/month
1107
- windows.
1108
- - **Landed in** — `core/placements/cap_rules.py` (the primitive),
1109
- `check_placement_caps` / `check_system_presentation_caps` /
1110
- `CapEnforcer.enforce` (the delegations).
1111
- - **Fail-closed in** — verdicts only ever tighten or stay: the exemption
1112
- affects categories that are user-prompted by design, and the state
1113
- alignment preserves more history, never less.
1114
- - **Proving test** — `tests/placements/test_cap_delegation.py`: a 12-case
1115
- characterization matrix green before AND after the refactor, the two
1116
- aligned behaviours run RED against the pre-refactor body, and a mutation
1117
- of the shared window arithmetic fails four tests across both entry points
1118
- (the shared maths is reached, not shadowed).
1119
-
1120
- ## 0.8.3
1121
-
1122
- One behavioural fix, Rust only. TypeScript and Python are unchanged and ship
1123
- this version for lockstep alone.
1124
-
1125
- ### Rust: a confirmed conversion did not retire the placement
1126
-
1127
- - **What changed** — the Rust port carried the full ImpressionHistory
1128
- machinery (`record_conversion`, `is_hidden_sync`, the retired cache) since
1129
- the port landed, but its placement resolver never consulted it. A user who
1130
- completed a placement's CTA — a confirmed conversion — kept seeing that
1131
- placement in this port alone, while TypeScript core
1132
- (`local-resolver.ts:610-612`, `:726`) and Python both hide it permanently.
1133
- This is the defect class plan 167's unshipped follow-up became as a
1134
- customer P1: paying customers shown the upsell they already bought.
1135
- - **Landed in** — the retirement gate is wired at both decision lanes: the
1136
- candidate filter (before the trigger gates, mirroring the TS order) and
1137
- the direct-lookup path, which now answers `placement_retired`, keyed by
1138
- the output's `rule_id` exactly as TS core and Python key it.
1139
- - **Fail-closed in** — the gate only ever hides; an empty or cold history
1140
- changes nothing, and a placement with no recorded conversion is untouched.
1141
- - **Proving test** — parity fixture `placement_conversion_retires`
1142
- (visible -> convert -> `placement_retired`, with an untouched control
1143
- staying visible, byte-identical across ts/py/rs; mutation-checked: making
1144
- the Rust gate inert diverges the snapshot) and
1145
- `server-rust/tests/local_runtime.rs`
1146
- (`a_confirmed_conversion_permanently_retires_the_placement`).
1147
-
1148
- ## 0.8.2
1149
-
1150
- One behavioural fix, Rust only. TypeScript and Python are unchanged and ship
1151
- this version for lockstep alone.
1152
-
1153
- ### Rust: provider-path rule selection was source-order, not most-permissive
1154
-
1155
- - **What changed** — on the provider path (`check_entitlement` with a rules
1156
- provider, the path a static config registers), the Rust port's §2.6.5
1157
- most-permissive selection scored each rule snapshot's root object instead
1158
- of its `fields` sub-object, where the adapter actually nests the score keys
1159
- (`limit_value`, `allowance`, `included_count`, `enabled`). Every rule
1160
- scored 0, so the deterministic tie-break — earliest in source order —
1161
- silently decided instead. Concretely: an entitlement carrying both a seat
1162
- rule (listed first) and a `usage_limit` rule at limit 2 returned **allowed**
1163
- at `used: 3` where TypeScript and Python return limited
1164
- (`usage_limit_reached`). Whether you were affected depends on rule order in
1165
- your Playbook, which is what made this silent. The ExportedConfig fallback
1166
- path (`derive_local_entitlement_from_configured_rules`) was NOT affected —
1167
- it passes the merged type-fields bag and scored correctly.
1168
- - **Landed in** — `0.8.2`.
1169
- - **Fail-closed in** — `0.8.2` (same release; no tolerated window).
1170
- - **Proving test** — parity fixture `entitlement_rule_seat_included_count`
1171
- (byte-locked ts ≡ py ≡ rs; diverged on exactly the shadowed-limit call until
1172
- the fix) and `most_permissive_scores_the_fields_sub_object_not_the_snapshot_root`
1173
- (Rust unit, mutation-checked). The pre-existing Rust unit test had authored
1174
- its score key at the snapshot root — a shape the adapter never emits — and
1175
- passed over the bug; it now uses the production shape.
1176
-
1177
- ---
1178
-
1179
- ## 0.8.1
1180
-
1181
- One behavioural fix, Python and Rust only. The TypeScript SDK is unchanged and
1182
- ships this version for lockstep alone.
1183
-
1184
- ### Python/Rust: cross-dimension segment AND no longer degrades to flat OR
1185
-
1186
- - **What changed** — the config evaluator's segment→dimension lookup was keyed
1187
- by the segment's `id` in the Python and Rust ports, where the TypeScript
1188
- canonical keys it by `handle`. Rule `segment_ids` are handle-valued, so on
1189
- any Playbook whose segment ids differ from their handles — every real
1190
- export — the ports' lookups all missed, every rule segment collapsed into
1191
- the uncategorised bucket, and a rule spanning two dimensions (which must
1192
- require BOTH, intra-dimension OR + cross-dimension AND) matched on EITHER.
1193
- Concretely: an entitlement rule scoped to `emea` (region) AND `admins`
1194
- (role) **granted** a user who was only in `emea`. It now denies, matching
1195
- the TypeScript SDK. If your integration passes a non-empty user segment set
1196
- to `derive_local_entitlement_from_configured_rules` and relies on a
1197
- cross-dimension rule, users who matched only one dimension lose the grant
1198
- on upgrade — that is the fix working. The built-in runtime fallback path
1199
- passes an empty segment set and is unaffected.
1200
- - **Landed in** — `0.8.1`.
1201
- - **Fail-closed in** — `0.8.1` (same release; no tolerated window).
1202
- - **Proving test** — parity fixtures `entitlement_segment_dimensions` /
1203
- `entitlement_segment_no_dim_bucket` (byte-locked TS ≡ Python ≡ Rust; the
1204
- regen diverged on exactly the cross-dimension calls until the fix), plus
1205
- `TestSegmentDimensionLookup` (Python) and `cross_dimension_and_*` (Rust).
1206
-
1207
- ## 0.8.0
1208
-
1209
- Plan 233 remediated four escalated defect families, and this is the release that
1210
- delivers them. Everything below sat merged on `main` and unpublished for the
1211
- length of that plan — 20 commits, twelve breaking changes — because the version
1212
- never moved off `0.7.13`.
1213
-
1214
- **Read this section before upgrading from `0.7.x`.** Three of these change live
1215
- behaviour rather than only types: segment-targeted payloads stop showing to
1216
- users outside the segment, `sdk.dismiss()` starts writing suppression where it
1217
- previously did nothing, and a converted placement stops coming back. Each is the
1218
- fix working, and each is visible to your users the moment you upgrade.
1219
-
1220
- ### The `tenantId` init option is now the authority over a Playbook's `tenant_id`
1221
-
1222
- - **What changed** — the Playbook's `tenant_id` used to win, and the init option
1223
- was a fallback applied only to legacy artifacts. That combination killed every
1224
- integration that served a canonical Playbook *and* passed the tenant at init:
1225
- the artifact had no `tenant_id` to win with, and the option was withheld
1226
- because the artifact was canonical, so init threw. The init option now wins.
1227
- The artifact's `tenant_id` is a **guard** — it exists so the CLI can refuse to
1228
- upload a config to the wrong tenant — and on a mismatch the SDK warns, naming
1229
- both values, and proceeds. It never fails init.
1230
- - **Landed in** — `0.8.0`
1231
- - **Fail-closed in** — n/a. This change makes init *succeed* where it used to
1232
- throw. The old behaviour was the failure.
1233
- - **Proving test** — `web-sdk/config-target-precedence-init.test.ts`
1234
-
1235
- ### Unrecognized and missing init options are compile errors
1236
-
1237
- - **What changed** — init options are exact-checked. A typo (`apikey` for
1238
- `apiKey`) or a stale option is a type error rather than a value the SDK
1239
- silently ignores. This catches the case TypeScript's excess-property check
1240
- never saw: options assembled in a variable, or in an un-annotated `useMemo`,
1241
- which is exactly how React integrations build them.
1242
- - **Landed in** — `0.8.0`
1243
- - **Fail-closed in** — same. Unknown keys were ignored at runtime before and
1244
- still are; what changed is that you cannot write them.
1245
- - **Proving test** — `web-sdk/init-options-exactness.test-d.ts`
1246
-
1247
- ### A truncated Playbook is a compile error at the `localRuntime` boundary
1248
-
1249
- - **What changed** — `UnvalidatedConfigArtifact` was `Record<string, unknown>`
1250
- and now structurally requires the body arrays (`plans`, `entitlements`,
1251
- `entitlement_rules`, `segments`, `content_ui_paths`). A Playbook missing one is
1252
- now caught by `tsc` instead of throwing at init.
1253
- - **Who this breaks** — only a caller who **explicitly annotated** their artifact
1254
- `Record<string, unknown>`; that must now be narrowed. A JSON module import and
1255
- a fetched artifact (`await res.json()`, typed `any`) both still compile with no
1256
- cast.
1257
- - **Landed in** — `0.8.0`
1258
- - **Fail-closed in** — same version, at compile time. Runtime validation was
1259
- already fail-closed and is unchanged.
1260
- - **Proving test** — `web-sdk/playbook-structural.test-d.ts`
1261
-
1262
- ### Init failure is observable without an SDK instance
1263
-
1264
- - **What changed** — when init fails the provider used to log and render children
1265
- anyway, so the SDK simply never started and every diagnostic probe was
1266
- unreachable *in precisely the failure mode that matters most*. `initStatus` is
1267
- now on the React context and is readable when the SDK instance is `null`, with
1268
- a non-empty `remediation` string on every init-path error.
1269
- - **Landed in** — `0.8.0`
1270
- - **Fail-closed in** — same.
1271
- - **Proving test** — `web-sdk/react/RevTurbineProvider.init-status.test.tsx`
1272
-
1273
- ### The rendered theme resolves through the branding ladder
1274
-
1275
- - **What changed** — `RevTurbineProvider` read `playbook?.theme` directly, so the
1276
- `branding` init option never reached `useRevTurbineTheme()`. `getBranding()`
1277
- and the rendered theme disagreed; that divergence *was* the defect. Both now
1278
- resolve from the same rung.
1279
- - **Landed in** — `0.8.0`
1280
- - **Fail-closed in** — same.
1281
- - **Proving test** — `web-sdk/react/RevTurbineProvider.branding-ladder.test.tsx`
1282
-
1283
- ### `RevTurbineThemeProvider` merges partial themes, and an app-mounted one wins
1284
-
1285
- - **What changed** — a partial theme replaced the defaults wholesale instead of
1286
- merging, so supplying one token dropped every other. Partial themes now merge.
1287
- Separately: if your app mounts its own `RevTurbineThemeProvider`, it wins over
1288
- the SDK's internal default, and a conflict warns in development.
1289
- - **Landed in** — `0.8.0`
1290
- - **Fail-closed in** — same.
1291
- - **Proving test** — `web-sdk/theme/ThemeContext.partial.test.tsx`,
1292
- `web-sdk/react/RevTurbineProvider.theme-nesting.test.tsx`
1293
-
1294
- ### Light/dark schemes no longer require re-initializing the SDK
1295
-
1296
- - **What changed** — additive. A `colorScheme` option and `setColorScheme()` swap
1297
- palettes while keeping SDK instance identity stable. The previous workaround
1298
- was re-initializing the SDK, which discarded its state.
1299
- - **Landed in** — `0.8.0`
1300
- - **Fail-closed in** — n/a, additive.
1301
- - **Proving test** — `web-sdk/react/RevTurbineProvider.color-scheme.test.tsx`
1302
-
1303
- ### `segment_chips` are enforced in the decision path
1304
-
1305
- - **What changed** — payload `segment_chips` were evaluated by
1306
- `explainPlacementDecision` but **not** by the decision path itself, so the
1307
- probe and the decision disagreed and a segment-targeted payload could show to a
1308
- user outside the segment. Both now call one shared helper, in every port.
1309
- - **Who this breaks** — an integration relying, knowingly or not, on
1310
- segment-targeted payloads showing to everyone will now see them correctly
1311
- restricted. **There is no grace period**: this was ruled a bug, not a behaviour
1312
- change.
1313
- - **Landed in** — `0.8.0`
1314
- - **Fail-closed in** — same version, and in all three runtimes together.
1315
- - **Proving test** — `tests/parity/fixtures/segment_chip_targeting.json` and
1316
- `tests/parity/fixtures/segment_evaluation.json`, run byte-identical across
1317
- TypeScript, Python and Rust.
1318
-
1319
- ### Dismissal actually suppresses, at the authored window
1320
-
1321
- - **What changed** — two defects. The interaction-state **read** omitted
1322
- `treatmentId` while the **write** included it, and the controllers always
1323
- populate it, so the keys could never match and dismissal suppression was dead
1324
- for every React integration. And the window was a hardcoded 24-hour literal
1325
- passed explicitly at every call site, which made both the authored
1326
- `cooldown_after_dismiss_days` and the 7-day default unreachable. The window now
1327
- resolves: explicit caller value → **authored config** → SDK default.
1328
- `remind_later_minutes` resolves independently, so "remind me" no longer means
1329
- "hide for a week".
1330
- - **Who this breaks** — dismissal now suppresses where it previously did nothing.
1331
- An integration that layered its own suppression on top may double-suppress.
1332
- - **Landed in** — `0.8.0`
1333
- - **Fail-closed in** — same. Note the *shape* of this one: it shipped in plan 167
1334
- with a proving test that dismissed **without** a `treatmentId`, so both keys
1335
- fell back to `'default'`, matched, and the feature appeared to work for a
1336
- month.
1337
- - **Proving test** — `web-sdk/customer-side-cooldown-suppression.test.ts`
1338
-
1339
- ### A dismissal is no longer treated as "no match"
1340
-
1341
- - **What changed** — `FixedSurfaceSlot` rendered its `fallback` whenever
1342
- `!visible`, and dismissing sets `visible: false` — so closing a placement put
1343
- the fallback back in the same space, a ghost replacing the thing just
1344
- dismissed. A slot now distinguishes the two: no match still renders `fallback`;
1345
- a dismissal renders nothing. `FixedSurfaceSlot` also gains `onDismissed`, and
1346
- `MessageSurfaceSlot`'s `onDismissed` — a public prop whose handler was built
1347
- and then discarded, so it could never fire — now works.
1348
- - **Who this breaks** — a host working around the ghost (one integration used a
1349
- `MutationObserver`) can remove the workaround. `MessageSurfaceSlot`'s
1350
- `onDismissed` goes from never firing to firing.
1351
- - **Landed in** — `0.8.0`
1352
- - **Fail-closed in** — same.
1353
- - **Proving test** — `web-sdk/placements/FixedSurfaceSlot.dismissal.test.tsx`
1354
-
1355
- ### `convert()` retires the placement instead of only reporting it
1356
-
1357
- - **What changed** — `convert()` emitted a `placement_interaction` event and
1358
- stopped: it never wrote the terminal state, so **a user who converted kept
1359
- being shown the upsell they had just paid for**. `dismiss()` and `snooze()` had
1360
- the identical report-but-never-act shape. All three now route through
1361
- `trackTreatmentInteraction`.
1362
- A second defect sat behind the same symptom: nothing in the decision path ever
1363
- *read* the terminal state. `isRetired` was written by `recordConversion` and
1364
- had no caller, so a 5-minute transient window was the only thing hiding a
1365
- converted placement — the upsell returned five minutes after checkout even
1366
- through the controller path. `getPlacementDecision` now checks retirement and
1367
- answers `retired_by_conversion`.
1368
- - **Who this breaks** — `sdk.dismiss()` now writes suppression state where it
1369
- previously did nothing.
1370
- - **Landed in** — `0.8.0`
1371
- - **Fail-closed in** — same.
1372
- - **Proving test** — `web-sdk/convert-retires-placement.test.ts`
1373
-
1374
- ### New: a slot-inventory probe
1375
-
1376
- - **What changed** — additive. `sdk.getRegisteredSlots()` returns the slots this
1377
- app has mounted, and `sdk.diagnoseSlotInventory()` diffs them against the
1378
- Playbook's placement triggers in both directions. A placement targeting a slot
1379
- no code mounts **can never show** and nothing reported it; a config-side audit
1380
- cannot see call sites.
1381
- - **Landed in** — `0.8.0`
1382
- - **Fail-closed in** — n/a, additive and diagnostic.
1383
- - **Proving test** — `web-sdk/slot-inventory-probe.test.ts`
1384
-
1385
- ---
1386
-
1387
- ## 0.7.0
1388
-
1389
- ### `soft_block` → `block_with_upsell`
1390
-
1391
- - **What changed** — the enforcement mode `soft_block` was renamed to
1392
- `block_with_upsell`, and with it the reason codes the SDKs return:
1393
- `usage_limit_reached_soft_block` → `usage_limit_reached_block_with_upsell`, and
1394
- `credit_balance_exhausted_soft_block` → `credit_balance_exhausted_block_with_upsell`.
1395
- **Any integration branching on the old reason string stops matching.**
1396
- - **Landed in** — `0.7.0`
1397
- - **Fail-closed in** — n/a. Behaviour is unchanged, and `soft_block` is still
1398
- accepted wherever it appears in an already-compiled Playbook, decoding to
1399
- exactly the decision it always made. Existing payloads keep working without
1400
- recompilation; only the **string you match on** moved.
1401
- - **Proving test** — the cross-language parity corpus (`tests/parity/`), which
1402
- asserts the reason codes byte-identically across all three runtimes.
1403
-
1404
- ---
1405
-
1406
- ## 0.6.0
1407
-
1408
- ### The server-side decision methods are gone
1409
-
1410
- - **What changed** — removed `RevTurbineServer.evaluate` / `getPlacement` /
1411
- `checkEntitlement` / `can` / `getTrialStatus` (Node), and the whole
1412
- `revturbine_server` module (Python).
1413
- - **Why the breakage is nominal** — every removed method called a hosted decision
1414
- endpoint that no longer exists, so each had been returning a **network error**
1415
- since that endpoint was deleted, in two languages, unnoticed — because the
1416
- cross-port gate only ever asked whether a method of that *name* existed.
1417
- - **What stays** — `RevTurbineServer` itself, and `createClientSession()`, which
1418
- mints the browser-safe token the client SDK's `clientSession` callback
1419
- consumes. An integration using the class only for that is unaffected.
1420
- - **Replacement** — evaluation is a pure function of (user context, Playbook) and
1421
- runs in the SDK. Use `LocalEvaluationServer` (Node) or `RevTurbineCustomerSdk`
1422
- (Python).
1423
- - **Landed in** — `0.6.0`
1424
- - **Fail-closed in** — effectively before `0.6.0`: the methods were already
1425
- erroring. `0.6.0` made the failure a compile/import error instead of a runtime
1426
- one.
1427
- - **Proving test** — `tests/no-decision-endpoint.test.ts`
1428
-
1429
- ---
1430
-
1431
- ## 0.5.0
1432
-
1433
- ### The access gate denies during server rendering
1434
-
1435
- - **What changed** — the gate is constructed inside a `useEffect`, and effects do
1436
- not run during SSR. So on the server there was no gate at all: `isLoading` read
1437
- false, `result` was null, `denied` computed false — and the gate emitted its
1438
- **children**. The server-rendered HTML for a gated feature was literally the
1439
- paid affordance. It now denies until a real verdict exists.
1440
- - **Why this one mattered** — it is a fail-open in the one place the client
1441
- cannot correct it. A crawler or a reader that never runs JS sees the paid
1442
- content.
1443
- - **Landed in** — `0.5.0`
1444
- - **Fail-closed in** — `0.5.0`. This *is* the fail-closed change.
1445
- - **Proving test** — `web-sdk/placements/AccessGateSurfaceSlot.ssr.test.tsx`
1446
-
1447
- ---
1448
-
1449
- ## 0.4.0
1450
-
1451
- ### An unresolvable plan identity denies in Python and Rust
1452
-
1453
- - **What changed** — the headless ports granted where TypeScript denied when a
1454
- user context carried no resolvable plan identity. The ports now deny, matching
1455
- TypeScript.
1456
- - **Landed in** — `0.4.0`
1457
- - **Fail-closed in** — `0.4.0` for Python and Rust; TypeScript already denied.
1458
- **The window between `0.3.0` and `0.4.0` is the expensive one** — a context
1459
- that failed closed in TS silently granted in the other two runtimes.
1460
- - **Proving test** — the cross-language parity corpus, which is what surfaced the
1461
- divergence: the gate had been green while `deriveLocalEntitlementFromConfiguredRules`
1462
- sat unreached by any fixture.
1463
-
1464
- ---
1465
-
1466
- ## 0.3.0
1467
-
1468
- This release is where the `plan: { id }` → `plan_handle` migration landed. It was
1469
- a **minor** bump carrying breaking changes, authorised because there were no
1470
- active tenants and only in-org code referenced the changed surfaces.
1471
-
1472
- ### `plan: { id }` → `plan: { handle }` / `plan_handle`
1473
-
1474
- - **What changed** — a plan's matching identity is its `unique_handle`.
1475
- `plan.id` is DB-internal and no longer participates in matching anywhere, in
1476
- any of the three runtimes.
1477
- - **Symptom if you do not migrate** — a context whose only plan signal is
1478
- `plan.id` now matches **no** plan-targeted rule and fails closed. It does not
1479
- error; it simply has no plan.
1480
- - **Landed in** — `0.3.0`
1481
- - **Fail-closed in** — `0.3.0`.
1482
- - **Proving test** — `web-sdk/user-context-exactness.test-d.ts` plus the
1483
- plan-identity parity fixtures
1484
- (`tests/parity/fixtures/entitlement_plan_identity_is_handle.json`,
1485
- `entitlement_no_plan_identity_denies.json`).
1486
-
1487
- ### `identify()` no longer accepts an arbitrary traits bag
1488
-
1489
- - **What changed** — unknown top-level context keys are a compile error.
1490
- Free-form values go under `custom`, via `update()`.
1491
- - **Landed in** — `0.3.0`
1492
- - **Fail-closed in** — `0.3.0`, at compile time.
1493
- - **Proving test** — `web-sdk/user-context-exactness.test-d.ts`
1494
-
1495
- ### `local_runtime_default_allow` → `entitlement_not_in_playbook`
1496
-
1497
- - **What changed** — the reason code was renamed with **no deprecated alias**,
1498
- and the headless runtimes' terminal fallback now **denies** where it used to
1499
- grant.
1500
- - **Landed in** — `0.3.0`
1501
- - **Fail-closed in** — `0.3.0`. The rename and the fail-closed flip shipped
1502
- together, deliberately: the old name described a grant, so keeping it as an
1503
- alias would have described the new behaviour incorrectly.
1504
- - **Proving test** — the fail-closed suites in `web-sdk/` and the corresponding
1505
- Python and Rust port suites.
1506
-
1507
- ---
1508
-
1509
- ## Before 0.3.0
1510
-
1511
- Versions `0.1.0` through `0.2.91` predate this changelog. Breaking changes in
1512
- that range are recorded only in commit history and release notes. If you are
1513
- upgrading from `0.2.x`, read the `0.3.0` section first — it is the release that
1514
- changed plan identity, and it is the one most likely to affect you.
1
+ # Changelog
2
+
3
+ Release notes and breaking changes for the RevTurbine SDKs. `@revturbine/sdk` (npm), `revturbine`
4
+ (PyPI) and `revturbine` (crates.io) are **version-locked** — they always ship the
5
+ same version number, so a version here applies to all three unless an entry says
6
+ otherwise.
7
+
8
+ Verified for `0.8.1`: npm `0.8.1`, PyPI `0.8.1`, crates.io `0.8.1` (2026-09-14).
9
+
10
+ Every breaking change is recorded in the same shape, because the thing that cost
11
+ an integration the most time was not the change itself but not being able to
12
+ answer *"which version broke this, and which version made it loud?"*:
13
+
14
+ | field | what it answers |
15
+ |---|---|
16
+ | **What changed** | the old shape and the new one, concretely |
17
+ | **Landed in** | the version that introduced the change |
18
+ | **Fail-closed in** | the version where the old shape stopped being silently tolerated. Often the same version; when it is **not**, the gap is where integrations break quietly. |
19
+ | **Proving test** | the test in this repo that would fail if the behaviour regressed |
20
+
21
+ A change whose "Fail-closed in" is later than its "Landed in" had a window where
22
+ the old shape was accepted and did nothing. Those windows are the expensive ones.
23
+
24
+ > **What this file is not yet.** A CI guard fails any PR that changes a
25
+ > `@public`-tagged export signature without touching this file. That tagging
26
+ > was thin (4 of ~73 methods) until BL-0005 (2026-09-22, no release — TSDoc
27
+ > and snapshot only) widened it to **34** of `RevTurbineCustomerSdk`'s **67**
28
+ > non-private methods, plus 5 provider/hook entry points
29
+ > (`initRevTurbine`, `RevTurbineProvider`, `useCan`, `useEntitlement`,
30
+ > `useGatedAction`) — every method a customer-facing guide, skill, the
31
+ > starter, or a demo app calls directly. The remaining ~33 methods are
32
+ > internal-only paths (called only by the SDK's own placement components,
33
+ > React bindings, or other internal packages) and stay untagged, so a
34
+ > breaking change to one of *those* still will not be caught automatically —
35
+ > it depends on whoever writes the PR. Entries here are reliable; the absence
36
+ > of an entry for a currently-untagged method is not yet proof that nothing
37
+ > changed.
38
+
39
+ > **Note on 0.x.** These packages are pre-1.0, so breaking changes ship in the
40
+ > **minor** position (`0.6.0` → `0.7.0`), not the major. `npm`'s caret on a `0.x`
41
+ > range does **not** span minors, so `^0.7.0` will not silently pull `0.8.0`.
42
+
43
+ Built-in decision reason values have a separate reviewed
44
+ [compatibility baseline](docs/reason-code-contract.md). Live fixture checks
45
+ protect those values independently of `@public` method tags; baseline changes
46
+ also require a changelog entry.
47
+
48
+ ---
49
+
50
+ ## 0.11.5
51
+
52
+ ### `registerSurfaceSlot()` no longer writes to the control plane (BL-0197)
53
+
54
+ **What changed.** Outside `local_only`, `registerSurfaceSlot()` used to mirror
55
+ every slot to the server: `upsertSurfaceSlot()` PUT a legacy surface-slot body
56
+ (`{name, slug, slot_type, status, targeting_rules, content, priority,
57
+ metadata}`) to `/api/placements/<slot id>`, then POSTed it to `/api/placements`
58
+ on the 404. `/api/placements` is RevTurbine's **authored-config** CRUD; it
59
+ validates against `PlacementSchema`, which requires `handle` and `category`, so
60
+ that body could only ever be rejected. In production every non-`local_only`
61
+ slot registration failed with `surface_slot_create_failed:422` and the React
62
+ runtime turned the rejection into a `slot_error`
63
+ (`dogfood_event_explorer`, 2026-09-24 18:36 UTC, request
64
+ `030ccf51-d74b-4d55-bf4e-2a929a4ab297`).
65
+
66
+ The write was also wrong in principle. On a same-origin integration the
67
+ signed-in user's session cookie authenticates the request, so a body the route
68
+ *did* accept would have created a draft placement in the tenant's Playbook just
69
+ from loading a gated page. Only the 422 prevented that.
70
+
71
+ `registerSurfaceSlot()` is now **client-local**: it records the slot in the
72
+ in-process registry and resolves, with no network write of any kind. A write
73
+ happens only when you configure `endpointOverrides.surfaceSlots` (or
74
+ `custom_endpoints.surfaceSlots`) to point at a slot-inventory service you run —
75
+ the same shape `persistPlacementTypes()` already uses. There is **no fallback
76
+ to `/api/placements`** under any configuration.
77
+
78
+ Nothing is lost by removing it. Surface-slot discovery is **ingestion-driven**:
79
+ the SDK already emits `slot_evaluated` / `slot_filled` / `slot_empty` /
80
+ `slot_suppressed` / `slot_error` and the `placement_*` lifecycle through
81
+ `/api/track`, carrying `surface_slot_id`, `slot_name`, `template_ids`,
82
+ `surface_type`, `category`, `decision_source` and `reason_codes`, and the
83
+ pipeline derives discovered slots from that telemetry. `SurfaceSlotSchema` is a
84
+ runtime-source (DISCOVERED) schema with `first_seen` / `last_seen` — it was
85
+ never meant to be written by a browser.
86
+
87
+ **Landed in.** `0.11.5` (BL-0197).
88
+
89
+ **Fail-closed in.** `0.11.5` — same version. The removed path had no silent
90
+ mode: before this release it threw `surface_slot_create_failed:<status>` on
91
+ every default-transport registration, so there is no window where the old
92
+ behaviour was quietly tolerated. An integration that genuinely relied on the
93
+ write must set `endpointOverrides.surfaceSlots`; one that did not was already
94
+ seeing `slot_error`.
95
+
96
+ **Proving test.** `web-sdk/surface-slot-registration-no-write.test.ts` — the
97
+ default transport performs zero writes (fetch spy, no `/api/placements` call)
98
+ and resolves even when the route replays the production 404/422; the override
99
+ path still PUTs, and falls back to POST on the override base, never on
100
+ `/api/placements`. `e2e/journey.transport.spec.ts` no longer stubs
101
+ `/api/placements` with a 200 (the stub that hid this): it records and aborts,
102
+ and `assertNoPlacementWrites()` fails the test if anything calls it.
103
+
104
+ **Ports.** No change — the Python and Rust SDKs never had a slot-registration
105
+ write.
106
+
107
+ ---
108
+ ## 0.11.4
109
+
110
+ ### The treatment-interaction wire record now carries `rule_handle` (BL-0200)
111
+
112
+ **What changed.** `flushInteractionQueue`'s projection onto
113
+ `POST /api/events/interactions` now includes `rule_handle`, taken from the same
114
+ `ruleHandle` on `RevTurbineTreatmentInteractionInput` that 0.11.3 began stamping
115
+ on the `placement_interaction` clickstream event.
116
+
117
+ 0.11.3 deliberately kept it off this record, and #530 asserted the omission with
118
+ a "never reaches the treatment-interaction wire record" test. The reasoning was
119
+ that the clickstream carries payload fields inside a JSON column — readable the
120
+ moment a producer sends them — while this record is column-shaped
121
+ (`placement_presentations`) and a new key needed a datasource migration.
122
+
123
+ The migration has since landed (revturbine-web ledger 015 added
124
+ `placement_exposure_attribution.rule_handle`), and the field is now declared on
125
+ `TreatmentInteractionInputSchema` (`revturbine-scaffold#394`, published as
126
+ `@revt-eng/*` v0.1.342). Sending it lets the app record the rule an exposure was
127
+ **decided by**, on the base exposure row, instead of waiting for the attribution
128
+ worker to reconstruct one from the clickstream when a conversion lands — which
129
+ is what makes presentation-grain analytics cuts per rule honest rather than
130
+ computed over the converted subset.
131
+
132
+ **Nothing to change in your integration.** `ruleHandle` was already public and
133
+ already populated by every `PlacementController` path; this only widens where the
134
+ value is sent. Spread, not set: the key is **absent** when no decision was in
135
+ scope. The contract accepts an explicit `null` for "a rule was selected and none
136
+ matched", but the SDK cannot distinguish that from "no decision in scope" —
137
+ `PlacementOutput.rule_id` is simply missing in both — so it asserts neither.
138
+
139
+ **No `@public` surface moved**, hence a patch release.
140
+
141
+ ## 0.11.3
142
+
143
+ ### `placement_interaction` now carries `rule_handle` (BL-0182)
144
+
145
+ **What changed.** #527 (BL-0062) stamped `rule_handle` at every verdict emit
146
+ site by reading `decision.output.rule_id`, but `placement_interaction` is not
147
+ a lifecycle event and does not spread `placementLifecycleBase` — its
148
+ placement keys are all optional, because a bare `trackTreatmentInteraction`
149
+ caller may supply none of them — so the click between exposure and outcome
150
+ was the one step of the funnel with no rule key. That is the step
151
+ click-through and CTR are computed over: the funnel was sliceable by rule at
152
+ both ends and not in the middle.
153
+
154
+ Five emit sites now reach the same stamped payload: `trackTreatmentInteraction`
155
+ (the projection itself), `PlacementController.trackInteraction`
156
+ (dismiss / remind_me_later / cta_clicked / cta_completed — and therefore every
157
+ React hook and `useSurfaceSlot` / `FixedSurfaceSlot` click handler built on
158
+ it), `PlacementController.fireImpression`, `trackOutputInteraction`
159
+ (output-addressed `convert()` / `dismiss()` / `snooze()`), and the
160
+ server-action `trackResult` resolver.
161
+
162
+ Spread, not set: `rule_handle` is **absent** when no decision was in scope
163
+ (a bare `trackTreatmentInteraction` call with no placement context), and
164
+ `null` on the wire means "a rule was selected and none matched" — conflating
165
+ the two would poison the slice's coverage numbers. The unknown-output branch
166
+ of `trackOutputInteraction` stamps nothing on purpose: no decision from this
167
+ SDK produced that output, so there is no rule to name.
168
+
169
+ Companion to `revturbine-scaffold#391`, which added `rule_handle` to the
170
+ `placement_interaction` payload contract and `ruleHandle` to
171
+ `RevTurbineTreatmentInteractionInput` (published as `@revt-eng/*` v0.1.339,
172
+ pinned in this release).
173
+
174
+ **No wire-shape change beyond the new optional field.** `rule_handle` is
175
+ optional-and-nullable on the schema side (#391), which keeps every
176
+ already-deployed SDK out of `quarantineVerdict`. `@public` signatures are
177
+ unchanged (`web-sdk/generated/public-api.json` untouched) and
178
+ `flushInteractionQueue` still maps the treatment-interaction record field by
179
+ field, so `ruleHandle` never reaches a customer webhook.
180
+
181
+ **Python and Rust are unaffected.** Neither port emits events.
182
+
183
+ **Landed in** `0.11.3` (BL-0182, #530).
184
+
185
+ **Fail-closed in** not applicable — additive field, nothing old is rejected.
186
+
187
+ **Proving test:** `web-sdk/customer-side-canonical-interaction.test.ts`.
188
+
189
+ ---
190
+
191
+ ### A gate no longer paywalls forever when it loses the cold-start config race (BL-0179)
192
+
193
+ **What changed.** BL-0177 (below) split `config_unavailable` into a transient and
194
+ a terminal state for **placements** and left `checkEntitlement` on the old
195
+ behaviour. So the same cold-start race denied entitlements instead: while the
196
+ Playbook load was in flight, `checkEntitlement` — and therefore `can()`,
197
+ `gate()`, `useCan`, `useEntitlement` and `useGatedAction` — returned the
198
+ fail-closed deny with reason `config_unavailable`, which is indistinguishable
199
+ from a rule denial. A gate mounted before config resolution rendered its paywall
200
+ and never re-evaluated, hiding a feature the user had paid for.
201
+
202
+ The entitlement path now takes the same two-state split:
203
+
204
+ | state | when | behaviour |
205
+ |---|---|---|
206
+ | **transient** | a Playbook load is in flight (`getPlaybookLoadState() === 'loading'`) | `checkEntitlement` waits for it (bounded, 4s) and re-evaluates. If the load outruns that bound, `EntitlementGate` **parks** the deny instead of publishing it — `result` stays `null`, `denied` stays `false`, `isLoading` stays `true`, and **no** `gate_evaluated` is emitted — then re-checks when the load settles, at most twice per cycle. |
207
+ | **terminal** | no config provider is configured, or the load settled without a config | unchanged: fail-CLOSED deny, reason `config_unavailable` in Server mode / `entitlement_not_in_playbook` in local mode, with its `resolution_failure` diagnostic and exactly one `gate_evaluated` carrying the verdict (and its `rule_handle`). |
208
+
209
+ The emission rule is the one worth stating plainly: **exactly one
210
+ `gate_evaluated` per settled verdict, and none for the transient state** — a
211
+ lost race is not an evaluation and must not enter the gate funnel as a denial.
212
+
213
+ **No API, wire or reason-code change.** `@public` signatures are unchanged
214
+ (`web-sdk/generated/public-api.json` is untouched), both reason codes keep their
215
+ meanings, and `tests/reason-contract.json` is unchanged. A `limited`-but-allowed
216
+ result is untouched; the fail-closed contract for terminal unavailability is
217
+ untouched.
218
+
219
+ **Python and Rust are unaffected by design**, for the same reason as BL-0177:
220
+ both take the Playbook as a required constructor argument, do no I/O, and have no
221
+ not-yet-loaded window.
222
+
223
+ **Landed in.** `0.11.3` (BL-0179, #529).
224
+
225
+ **Fail-closed in.** Not applicable — terminal behaviour is unchanged; only the
226
+ transient race is now absorbed.
227
+
228
+ **Proving test.** `web-sdk/react/useCan.config-race.test.tsx` (a gate mounted
229
+ mid-race ends on the rule's verdict, allow and deny) and
230
+ `web-sdk/entitlement-config-race.test.ts` (both states, the emission rule, and
231
+ the bounded post-bound retry for `PlacementController` and `EntitlementGate`,
232
+ reached by injecting a `0` wait bound rather than with fake timers).
233
+
234
+ ---
235
+
236
+ ### A slot no longer paints its fallback forever when it loses the cold-start config race (BL-0177)
237
+
238
+ **What changed.** `getPlacementDecision` returns `config_unavailable` when the
239
+ Playbook has not arrived, uncached, specifically so a retry can succeed — but
240
+ nothing retried. `useSurfaceSlot` / `FixedSurfaceSlot` decide once per mount, so
241
+ on a cold `revturbine_server` load, whenever the first decision beat the two-hop
242
+ bootstrap → `/api/sdk/config` chain, the slot rendered its `fallback`
243
+ permanently and every integration had to hand-roll a retry.
244
+
245
+ `config_unavailable` now has two distinct states and the SDK handles each:
246
+
247
+ | state | when | behaviour |
248
+ |---|---|---|
249
+ | **transient** | a Playbook load is in flight | `getPlacementDecision` waits for it (bounded, 4s) and re-resolves. If the load outruns that bound, `PlacementController` re-decides when it settles — at most twice per load cycle. The slot stays in `isLoading` meanwhile and emits **no** `placement_resolved` / `slot_empty`: a lost race is not a resolution and must not enter the funnel as one. |
250
+ | **terminal** | no config provider is configured, or the load settled without a config | unchanged from before: the decision is `config_unavailable`, `visible: false`, uncached, with the resolution-failure diagnostic and the lifecycle + slot events. Bounded retries mean it settles rather than spinning. |
251
+
252
+ **No API, wire or reason-code change.** `config_unavailable` is still the reason
253
+ code, the decision shape is untouched, and `tests/reason-contract.json` is
254
+ unchanged. Customer code that already hand-rolls a retry keeps working — it is
255
+ now redundant, not wrong.
256
+
257
+ **Python and Rust are unaffected by design.** Both ports take the Playbook as a
258
+ required constructor argument and raise on a missing or malformed one
259
+ (`server-python/src/revturbine/sdk.py` `__init__`, `server-rust/src/sdk.rs`
260
+ `new`), perform no I/O, and never emit `config_unavailable` — there is no
261
+ not-yet-loaded window to retry. This is a browser/hosted-mode state only.
262
+
263
+ **Landed in.** `0.11.3` (BL-0177, #528).
264
+
265
+ **Fail-closed in.** Not applicable — the terminal behaviour is unchanged; only
266
+ the transient race is now absorbed.
267
+
268
+ **Proving test.** `web-sdk/placements/FixedSurfaceSlot.config-race.test.tsx`
269
+ (both states), plus `e2e/journey.transport.spec.ts`, whose two hand-rolled retry
270
+ loops were deleted — a retry loop reappearing there is the regression signal.
271
+
272
+ ---
273
+
274
+ ## 0.11.1
275
+
276
+ ### The generated schema *types* gained their `Playbook*` names (BL-0165)
277
+
278
+ **What changed.** `0.11.0` renamed every option, keyword and method that carries a
279
+ Playbook. It did not rename the **generated type identifiers**, which come from
280
+ scaffold and are vendored here — so a `0.11.0` integration still had to import
281
+ `ExportedConfigSegmentsItem` to name a segment. Those types now have `Playbook*`
282
+ spellings too.
283
+
284
+ | deprecated | canonical |
285
+ |---|---|
286
+ | `ExportedConfigSegmentsItem` | `PlaybookSegmentsItem` |
287
+ | `ExportedConfigSegmentsItemPredicatesItem` | `PlaybookSegmentsItemPredicatesItem` |
288
+ | `ExportedConfigPlacementItem` | `PlaybookPlacementItem` |
289
+ | `ExportedConfigUiPathActionType` | `PlaybookUiPathActionType` |
290
+ | `ExportedConfig` | `Playbook` (already shipped in `0.11.0`) |
291
+
292
+ **This renames nothing on the wire.** The names are generated from exported keys
293
+ of scaffold's Zod barrel: both spellings resolve to the **same schema object**, so
294
+ no payload field, default or validation rule differs between them, and the OpenAPI
295
+ component names are unchanged (they come from `.meta({ id })` on the underlying
296
+ schemas, not from the key). A Playbook written by an older SDK parses byte-for-byte
297
+ identically. Scaffold's payload contract — `bundle_schema_version` /
298
+ `bundle_min_readable_schema_version` — is untouched, so there is no minimum-reader
299
+ floor to raise.
300
+
301
+ **The aliases are duplicate definitions, not type aliases.** Scaffold's generators
302
+ emit one full TS type, Pydantic model and serde struct per barrel key rather than an
303
+ alias, so in Python (`revturbine.types`) and Rust (`revturbine::types`) the old
304
+ names remain as their own complete models/structs, generated from the same schema.
305
+ No hand-written shim exists in either port, and none is wanted: it would collide
306
+ with the generated definition. In TypeScript the `core` barrel re-exports the old
307
+ pair with `@deprecated` TSDoc.
308
+
309
+ Requires `@revt-eng/schema` / `@revt-eng/core` ≥ 0.1.335, which added the
310
+ `Playbook*` keys upstream (scaffold #387).
311
+
312
+ Ruling: Kent, 2026-09-23 (BL-0156 — `ExportedConfig` naming deprecated, Playbook
313
+ canonical).
314
+
315
+ **Landed in** `0.11.1` (additive — every old name still resolves).
316
+ **Fail-closed in** `0.12.0`, when BL-0167 removes the `ExportedConfig*` keys from
317
+ scaffold's barrel and the generated definitions disappear from the vendored types
318
+ along with them. That is the same window as the `0.11.0` option/method aliases, so
319
+ an integration has one removal to absorb, not two.
320
+
321
+ **Proving test:** scaffold's `src/core/zod/playbook-generated-names.test.ts` (each
322
+ `Playbook*` key is the same object as its `RevTurbineConfig*` and `ExportedConfig*`
323
+ counterparts; a legacy `export-config.json` payload parses to an equal result
324
+ through both spellings of the config schema), plus this repo's
325
+ `scripts/check-vendored-types.mjs` (the vendored py/rs copies agree with the pin).
326
+
327
+ **Public-API snapshot: unchanged.** `pnpm check:public-api` still reports the same
328
+ **62** `@public` exports and `web-sdk/generated/public-api.json` is byte-identical,
329
+ because the `core` barrel's type re-exports carry no `@public` tag. Recorded here
330
+ rather than left implicit: a rename touching the SDK's type vocabulary that moves
331
+ *no* snapshot entry is worth stating, so a reader does not go looking for the diff.
332
+ No existing export's signature changed and none was removed.
333
+
334
+ ## 0.11.0
335
+
336
+ ### `Playbook` is the canonical name for every option that carries one (BL-0156)
337
+
338
+ **What changed.** `ExportedConfig` is dead vocabulary. Plan 118 renamed the
339
+ domain object to **Playbook** and plan 104 renamed the schema type to
340
+ `RevTurbineConfig`, but the *option*, *keyword* and *method* names that carry a
341
+ Playbook around the SDK still spelled it `exportedConfig` / `exported_config`.
342
+ Every one of them now has a `Playbook`-named counterpart; every old name stays
343
+ as a deprecated alias that still works.
344
+
345
+ TypeScript:
346
+
347
+ | deprecated | canonical |
348
+ |---|---|
349
+ | `localRuntime.exportedConfig` | `localRuntime.playbook` (already shipped; see below) |
350
+ | `localRuntime.resolvers.resolveExportedConfig` | `localRuntime.resolvers.resolvePlaybook` |
351
+ | `configProvider.getExportedConfig()` | `configProvider.getPlaybook()` |
352
+ | `sdk.getExportedConfig()` | `sdk.getPlaybook()` |
353
+ | `getPolicy().exportedConfigVersion` | `getPolicy().playbookVersion` |
354
+ | `BrowserRuntimeOptions.exportedConfig` | `BrowserRuntimeOptions.playbook` |
355
+ | `LocalEvaluationServerOptions.exportedConfig` | `LocalEvaluationServerOptions.playbook` |
356
+ | `ExportedConfigProvider` (type) | `RevTurbineConfigProvider`, also exported as `PlaybookProvider` |
357
+ | `ExportedConfig` (type) | `Playbook` |
358
+
359
+ Python: `RevTurbineCustomerSdk(exported_config=…)`, `LocalRuntime(exported_config=…)`,
360
+ `LocalRuntime.get_exported_config()`, `create_static_placement_resolver(exported_config=…)`,
361
+ `derive_local_entitlement_from_configured_rules(exported_config=…)`,
362
+ `configured_plan_name_from_exported_config`, `parse_exported_config_or_throw` and
363
+ `static.ExportedConfig` all gained `playbook`-spelled counterparts.
364
+
365
+ Rust: `configured_plan_name_from_exported_config` is now
366
+ `configured_plan_name_from_playbook`, with the old name kept as the crate's
367
+ first `#[deprecated]` item. Rust has no keyword arguments, so nothing else in
368
+ that port was a caller-visible name.
369
+
370
+ `RevTurbineConfigProvider`'s two accessors are both OPTIONAL on the interface so
371
+ that an existing `implements RevTurbineConfigProvider` clause keeps compiling;
372
+ the `configProvider` option intersects it with a union that still requires
373
+ exactly one of them, so a provider implementing neither is a compile error where
374
+ it is passed.
375
+
376
+ Reading a deprecated name logs **one** development-build warning per runtime
377
+ (one `DeprecationWarning` per process on Python) naming the canonical
378
+ replacement — one flag for every alias, so an integration still spelling several
379
+ of them gets a single line, not a wall. Production builds are silent. Requires
380
+ `@revt-eng/core` ≥ 0.1.331, which made the same rename upstream (scaffold #380).
381
+
382
+ Ruling: Kent, 2026-09-23 (BL-0156).
383
+
384
+ **Landed in** `0.11.0`. **Fail-closed in** `0.12.0` for the `ExportedConfig`
385
+ aliases — until then every old name works and warns once.
386
+
387
+ **Proving test:** `web-sdk/playbook-option.test.ts` (canonical never warns, the
388
+ alias still resolves, one warning across three read sites, both spellings reach
389
+ the same Playbook at every public read site),
390
+ `server-python/tests/test_playbook_option.py` (the same contract plus
391
+ `get_exported_config()`), and `server-rust/src/user_context.rs`
392
+ `playbook_rename_tests` (the alias returns exactly what the canonical returns).
393
+
394
+ ### `localRuntime.playbook` is the canonical local-mode config key
395
+
396
+ **What changed.** The record this file owed and never carried: `localRuntime.playbook`
397
+ shipped earlier as the canonical spelling of `localRuntime.exportedConfig`, with
398
+ `resolveLocalPlaybook()` as the single resolver deciding precedence, but no
399
+ changelog entry was ever written for it — so an integration could not date the
400
+ change. It is recorded here rather than back-dated, because the version it
401
+ landed in is not the version this entry appears in and pretending otherwise is
402
+ exactly the confusion the "Landed in" / "Fail-closed in" split exists to
403
+ prevent. As of `0.11.0` the alias also warns once (it did not before).
404
+
405
+ **Landed in** a release before `0.11.0` (additive; the alias never stopped
406
+ working). **Fail-closed in** `0.12.0`, with the rest of the `ExportedConfig`
407
+ aliases.
408
+
409
+ **Proving test:** `web-sdk/playbook-option.test.ts` — `resolveLocalPlaybook`
410
+ accepts either key, prefers `playbook`, and warns only for the alias.
411
+
412
+ ### `publicKey` is the only browser credential; `ingestPublicKey` is gone (BL-0113)
413
+
414
+ **What changed.** `0.10.0` made `publicKey` the browser credential and kept
415
+ `apiKey` and `ingestPublicKey` working as aliases "for one minor". This is that
416
+ minor:
417
+
418
+ - **`ingestPublicKey` is removed from `RevTurbineInitOptions`.** Passing it is
419
+ now a **type error**, including when the options are built in a variable
420
+ (`ExactInitOptions` rejects it there too).
421
+ - **`apiKey` is no longer read as a browser credential.** It still exists, and
422
+ still means exactly one thing: the secret **server key**, for
423
+ `@revturbine/sdk/server` and for the headless SDK on a backend. A browser init
424
+ that supplies only `apiKey` now resolves **no** browser credential and fails
425
+ at init, instead of silently sending a server key as the bearer.
426
+
427
+ `resolveBrowserPublicKey()` reads `publicKey` and nothing else, and
428
+ `resetBrowserKeyAliasWarning()` is gone with the warning it reset. Keyless
429
+ local-only init is unchanged, and the plan 95 anonymous `sdk_init` beacon now
430
+ keys off `publicKey` alone.
431
+
432
+ Ruling: Kent, 2026-09-23 (BL-0113), closing the window plan 257 opened.
433
+
434
+ **Landed in** `0.11.0`. **Fail-closed in** `0.11.0` — the same release. This IS
435
+ the fail-closed half of the `0.10.0` entry below; there is no further tolerance
436
+ window.
437
+
438
+ **Proving test:** `web-sdk/public-key-option.test.ts` (`publicKey` is the bearer
439
+ on ingest and every control-plane fetch; `apiKey` resolves nothing; nothing
440
+ warns), `web-sdk/customer-side-ingest.test.ts` (the bearer no longer carries the
441
+ server key), and `web-sdk/init-options-exactness.test-d.ts` (`ingestPublicKey`
442
+ is a type error inline AND in a variable — if the key is ever re-added, `tsc`
443
+ fails on the unused `@ts-expect-error`).
444
+
445
+ ---
446
+
447
+ ## 0.10.10
448
+
449
+ ### Trial tokens now reach placement content, not only `getPersonalizationTokens()` (BL-0169)
450
+
451
+ **What changed.** A placement whose copy authors `{{trial_days_remaining}}` or
452
+ `{{trial_days_total}}` now renders the live values. Content interpolation sources
453
+ its token map from the **output content itself**, so a provider-derived token
454
+ only reaches the copy if the resolver writes it onto that content first. The
455
+ usage lane always did (`usage_current`, `usage_limit`, `usage_percent`,
456
+ `usage_remaining`, `reset_date`); the trial lane never did, so a `trial_ending`
457
+ body reading `"{{trial_days_remaining}} days left"` shipped the literal
458
+ `{{trial_days_remaining}}` to the end user — on every port. The two names were
459
+ derived for `getPersonalizationTokens()` all along, which is why the gap survived:
460
+ a host that read the token map saw the right numbers and a host that authored the
461
+ token into copy did not.
462
+
463
+ | | before | now |
464
+ |---|---|---|
465
+ | `getPersonalizationTokens().trial_days_remaining` | live value | live value (unchanged) |
466
+ | content `{{trial_days_remaining}}` / `{{trial_days_total}}` | literal `{{…}}` | live value |
467
+ | `outputContent.trial_days_remaining` / `_total` | absent | written when the plan provider carries a finite number |
468
+
469
+ Identical on all three ports (`ts:local-resolver.ts`,
470
+ `py:core/placements/local_resolver.py`, `rs:placements/static_resolver.rs`): the
471
+ same two token names, a `Number.isFinite` guard, provider state winning over an
472
+ authored content value of the same key, and the value passed through **without
473
+ widening** — `day_number` 7 + `days_remaining` 3 is `trial_days_total` `10`, never
474
+ `10.0` (BL-0155).
475
+
476
+ **Who this reaches.** Any host whose placement copy authors either token. Copy
477
+ that hard-coded one of those keys as a decorative literal now has it overwritten
478
+ by live state — the same precedence the usage lane and
479
+ `derivePlacementPersonalizationTokens` have always had. `{{trial_plan_name}}` and
480
+ `{{trial_features_used}}` remain **not yet wired** by the placement-studio-ui
481
+ spec's own note and are untouched.
482
+
483
+ **Landed in.** `0.10.10`.
484
+
485
+ **Fail-closed in.** `0.10.10` — absence still leaves the raw token standing
486
+ rather than rendering `0`, so a host with no trial provider state sees exactly
487
+ what it saw before.
488
+
489
+ **Proving test.** Parity scenario `trial_tokens_in_content` under
490
+ `"normalize": "preserve-representation"` (byte-locked ts ≡ py ≡ rs), plus
491
+ `py:tests/placements/test_local_resolver.py` and `rs:tests/static_resolver.rs`
492
+ `trial_tokens_are_injected_from_plan_provider_state` and its two neighbours,
493
+ mirroring the scaffold-side `local-resolver.test.ts` cases. Needs
494
+ `@revt-eng/core` 0.1.331 or later (scaffold #382) for the TS half; this release
495
+ pins 0.1.332.
496
+
497
+ ---
498
+
499
+ ## 0.10.9
500
+
501
+ ### The trial-status overlay no longer changes a number's type (BL-0155)
502
+
503
+ **What changed.** The `UserTrialStatus` → `trial_*` PlanProviderState overlay now
504
+ passes each numeric field through on every port, instead of two ports widening
505
+ it to a float. The canonical behaviour is the TS SDK's
506
+ `synthesizeProviderContext` (`web-sdk/customer-side.ts`, the `planTrialFields`
507
+ block), which spreads every `UserTrialStatus` member verbatim: an integer
508
+ `progress_percent` stays an integer on the provider state, and
509
+ `trial_days_total` is `day_number + days_remaining` in the inputs' own kind, so
510
+ `7 + 3` is `14`. The two server ports diverged from it:
511
+
512
+ | field | Python before | Rust before | all three now |
513
+ |---|---|---|---|
514
+ | `progress_percent` → `trial_progress_percent` | `float(v)` | verbatim | verbatim |
515
+ | `days_remaining` → `trial_days_remaining` | `float(v)` | verbatim | verbatim |
516
+ | `usage_consumed` → `trial_usage_consumed` | `float(v)` | verbatim | verbatim |
517
+ | `usage_limit` → `trial_usage_limit` | `float(v)` | verbatim | verbatim |
518
+ | `in_trial` → `trial_active` | `bool(v)` | verbatim | verbatim |
519
+ | derived `trial_days_total` | `float(a) + float(b)` | `f64` sum | `int + int` → `int`; any fractional half → float |
520
+
521
+ **Who this reaches.** Only a host that reads the provider state it built —
522
+ `revturbine::overlay_trial_status_on_plan_provider` on Rust, or the merged
523
+ `PlanProviderState` on Python — and cares whether it holds `70` or `70.0`
524
+ (serializing it, comparing it to an integer, or logging it). No decision
525
+ changes: every reader in the trial-gating layer widens on read, which is exactly
526
+ why the divergence survived. A non-numeric `day_number`/`days_remaining` half
527
+ now derives no total on Python instead of raising, matching Rust's existing
528
+ numeric guard.
529
+
530
+ **Landed in.** `0.10.9`.
531
+
532
+ **Fail-closed in.** `0.10.9` — there was no tolerated-old-shape window; the
533
+ representation simply changes.
534
+
535
+ **Proving test.**
536
+ `server-python/tests/test_trial_overlay_upsert.py::test_overlay_preserves_integer_numeric_representation`
537
+ and `server-rust/src/sdk.rs::overlay_preserves_integer_numeric_representation`
538
+ — both assert the *type*, not just the value, because `100 == 100.0` in Python.
539
+ Scenario `trial_overlay_integer_fields` locks that the three ports still decide
540
+ identically from an all-integer trial status.
541
+
542
+ > **Correction, 2026-09-23 (BL-0158, harness-only — no release).** This entry
543
+ > originally said the parity corpus *cannot* see this class of divergence,
544
+ > because `tests/parity/normalize.*` rule 4 collapses integral floats by design
545
+ > and nothing in the corpus returned the overlaid provider state. Both halves
546
+ > are now closed and the sentence no longer holds:
547
+ > `trial_overlay_integer_fields` drives `resolveProviders` (already shipped on
548
+ > all three runtimes) under a new per-scenario
549
+ > `"normalize": "preserve-representation"` flag that turns the collapse off, so
550
+ > `14` and `14.0` are different bytes and the cross-language byte-diff fails on
551
+ > a widened field. No public API changed; the harness gained the ability to see
552
+ > provider state.
553
+
554
+ ---
555
+
556
+ ## 0.10.8
557
+
558
+ ### `{{recommended_plan_name}}` and `{{plan_name}}` no longer reach end users as raw tokens (BL-0121)
559
+
560
+ **What changed.** The placement-decision lane now substitutes the five tokens
561
+ the SDK resolves from the Playbook — `plan_name`, `plan_price`,
562
+ `upgrade_plan_price`, `recommended_plan_handle`, `recommended_plan_name` —
563
+ into `RevTurbinePlacementDecision.content` (and the mirrored
564
+ `decision.output.content`). It previously substituted `plan_price` and
565
+ `upgrade_plan_price` only.
566
+
567
+ `recommended_plan_handle` / `recommended_plan_name` were already derived, by
568
+ the parity-locked `resolveRecommendedPlanTokens` dispatch, and already readable
569
+ via `getPersonalizationTokens()`. Nothing wrote them into rendered content, so
570
+ a placement authored with `"Upgrade to {{recommended_plan_name}}"` shipped the
571
+ literal braces to the end user. Observed on the CybeDefend demo, 2026-09-22.
572
+
573
+ Two properties of the substitution are deliberate:
574
+
575
+ | input | result |
576
+ |---|---|
577
+ | a token the SDK owns but cannot resolve (top-of-ladder user has no next plan) | empty string — the spec's documented empty-token convention |
578
+ | a token the SDK does not own (`{{usage_percent}}`, an app-defined token) | left verbatim, so the React render lane still resolves it |
579
+
580
+ `plan_name` resolves through the plan's `unique_handle`, the matching identity
581
+ — the lookup used to be handed the plan *object*, which by design resolves
582
+ nothing, so `{{plan_name}}` rendered raw for every user identified by
583
+ `plan_handle`.
584
+
585
+ **Landed in.** `0.10.8`.
586
+
587
+ **Not fixed here.** `{{upgrade_plan_price}}` still renders the ANNUAL amount
588
+ for a plan that has both an annual and a monthly variation. Variation
589
+ preference keys off the user's billing cadence, but no supported input carries
590
+ it (`billing_period` is absent from `UserContextSchema` and from the recognized
591
+ `identify()` / `update()` keys), so selection falls through to the
592
+ alphabetically-first variation and `<plan>_annual` always wins. Closing it
593
+ needs a schema field for the cadence and a contract for which period the token
594
+ reflects when the cadence is unknown; both are open on BL-0121.
595
+
596
+ **Proving test.** `web-sdk/customer-side-upgrade-tokens.test.ts`.
597
+
598
+ ---
599
+
600
+ ## 0.10.7
601
+
602
+ ### The Python and Rust ports stop filtering payloads on `status` (BL-0151)
603
+
604
+ **What changed.** Payload `status` is no longer a runtime predicate in any port.
605
+ Python and Rust required `status == "active"` on a placement payload before it
606
+ could become a candidate, and read a `status` off each content-linked studio
607
+ payload before overlaying its copy. Both now ignore it, matching the TypeScript
608
+ port, which never gated on it.
609
+
610
+ | | Before | After |
611
+ |---|---|---|
612
+ | Placement payload candidacy (Python, Rust) | required `status == "active"` | every payload, status ignored |
613
+ | Content-linked copy overlay (Python, Rust) | required the studio payload's `status` to read `active` | always overlaid |
614
+ | TypeScript | already ignored `status` | unchanged |
615
+
616
+ **Why it mattered.** `status` is not a field of the exported Playbook.
617
+ `RevTurbineConfigStudioPayload` and `RevTurbineConfigPlacementPayloadItem` carry
618
+ no `status` key, unknown keys are stripped on parse, and the published JSON
619
+ Schema is `additionalProperties: false` — because runtime status is *derived*
620
+ control-plane side and the stored column was dropped. So `status == "active"` was
621
+ false for **every** payload of a real Playbook: the Python and Rust resolvers
622
+ indexed no candidates at all and returned `placement_not_found`, and their
623
+ content-lookup adapters dropped every content-linked payload, keeping the inline
624
+ copy where TypeScript overlaid the linked block. A config whose first payload
625
+ carried a stray authored `status` also decided differently across ports.
626
+
627
+ The cross-language parity gate could not see any of this: the only fixtures
628
+ reaching these paths hand-write `status` on each payload — a key the schema would
629
+ strip — so the ports were compared on a shape no Playbook has.
630
+
631
+ **Landed in.** 0.10.7 (`server-python`, `server-rust`). No `@revt-eng/core`
632
+ change rides with it: TypeScript was already correct, so there is no scaffold
633
+ release and no pin bump.
634
+
635
+ **Fail-closed in.** n/a — this release removes a fail-*closed* filter. Python and
636
+ Rust consumers on a real Playbook go from no decision to the decision
637
+ TypeScript has always returned.
638
+
639
+ **Proving test.** `tests/parity/fixtures/payload_status_filter.json` — two lanes:
640
+ a stray authored `status` that disagrees with drag order (payload 1 `draft`,
641
+ payload 2 `active`; payload 1 must still win), and the real wire shape with no
642
+ `status` anywhere plus a content-linked overlay. Mutation-checked by reinstating
643
+ the Python filter, which diverges on the first call. Plus
644
+ `server-python/tests/placements/test_local_resolver.py`,
645
+ `test_json_content_provider.py` and `server-rust/tests/static_resolver.rs`, each
646
+ covering both the stray-value and the no-key case.
647
+
648
+ **Who is affected.** Every `revturbine` (PyPI) and `revturbine` (crates.io)
649
+ consumer resolving placements from a schema-valid exported Playbook — that is,
650
+ one produced by the control plane rather than hand-written with a `status` field.
651
+ Those integrations were receiving no placement decisions at all.
652
+
653
+ ---
654
+
655
+ ## 0.10.6
656
+
657
+ ### The trial-status PlanProvider overlay ships in the Rust crate (BL-0153)
658
+
659
+ **What changed.** `revturbine::overlay_trial_status_on_plan_provider` is a new
660
+ public function on the Rust crate: it maps a runtime `UserTrialStatus` onto the
661
+ `trial_*` fields of a resolved PlanProviderState, the fields the placement
662
+ resolver's `trial_progress` / `trial_ending` / `trial_ended` /
663
+ `trial_converted` gates and milestone supersession read. Python has always done
664
+ this inside its shipped package
665
+ (`revturbine.sdk._overlay_trial_status_on_plan_provider`); on Rust the mapping
666
+ existed only as a private helper the facade used, so a host that assembles its
667
+ own provider context — including this repo's own parity runner — had to
668
+ re-implement it. Additive: no existing signature changed.
669
+
670
+ Porting Python's mapping faithfully corrected two Rust-only divergences in the
671
+ overlay the facade applies:
672
+
673
+ | `UserTrialStatus` field | Rust before | Rust now (= TS/Python) |
674
+ |---|---|---|
675
+ | `day_number` + `days_remaining` | not derived | `trial_days_total = day_number + days_remaining`, only when both are present |
676
+ | `day_number` | written to `trial_day_number` | not written — no provider-state field reads it |
677
+ | `usage_entitlement_handle` | dropped | `trial_usage_entitlement_handle` |
678
+
679
+ `trial_days_total` is the input to the time-mode progress fallback in
680
+ `placements::trial_gating`, so before this the fallback could never fire on the
681
+ Rust port.
682
+
683
+ **Landed in.** `0.10.6`.
684
+
685
+ **Fail-closed in.** `0.10.6` — the parity facade-presence gate
686
+ (`tests/parity/facade-surface.json`) no longer allow-lists a runner-local
687
+ overlay, so a future re-implementation harness-side fails the gate.
688
+
689
+ **Proving test.** `server-rust/src/sdk.rs` `overlay_maps_every_canonical_trial_field`,
690
+ `trial_days_total_requires_both_halves`, `overlay_does_not_clobber_base_state_with_null`
691
+ (mirroring `server-python/tests/test_trial_overlay_upsert.py`), plus the
692
+ `trial_ending_days_before_end`, `trial_ended_post_expiry` and
693
+ `trial_progress_milestone_supersession` parity fixtures.
694
+
695
+ ---
696
+
697
+ ## 0.10.5
698
+
699
+ ### Trial-only local integrations get provider context (BL-0120)
700
+
701
+ **What changed.** `synthesizeProviderContext()` — the fallback that builds
702
+ `DomainProvider` state from `userContext` when no explicit domain provider is
703
+ registered — dropped an integration's trial data whenever no commercial
704
+ `plan` / `plan_handle` was also present. An app supplying **only**
705
+ `initialData.trialStatus` (or `setTrialInstances()` / `setTrialStatus()` with
706
+ no plan) got no provider context at all: `providers.plan` came back
707
+ `undefined`, so `{{trial_days_remaining}}` (and every other `trial*` token
708
+ `derivePlacementPersonalizationTokens` derives from `providers.plan`) stayed
709
+ raw, unresolved, in placement copy. Reported against the CybeDefend demo
710
+ (SDK 0.7.13): a `trial_ending` placement with `in_trial: true,
711
+ days_remaining: 3` left `{{trial_days_remaining}}` literal in the rendered
712
+ body.
713
+
714
+ Two omissions, same root cause — trial was never checked alongside
715
+ `plan` / `plan_handle` / `usage` / `tiers` / `experiments`:
716
+
717
+ - the early-return guard (`if (!plan && !planHandle && !usage && !hasTiers
718
+ && !hasExperiments) return undefined;`) treated a trial-only integration as
719
+ having no signal whatsoever;
720
+ - even past that guard, the returned `plan` key itself was gated on
721
+ `plan || planHandle` — so the trial fields (`trialActive`,
722
+ `trialDaysRemaining`, etc.) it computed were still discarded for a
723
+ plan-less trial.
724
+
725
+ Both gates now also check `hasTrial` (an explicit trial signal — the default
726
+ untouched `{ in_trial: false }` sentinel does not count, so the omitted-signal
727
+ short-circuit is otherwise unchanged for integrations that supply nothing at
728
+ all). `usage`-only, `tiers`-only, and `experiments`-only integrations already
729
+ threaded through correctly before this change; trial was the only signal
730
+ missing from both checks.
731
+
732
+ No public API change — `synthesizeProviderContext` is private, and the fix is
733
+ additive: a plan-less trial integration now gets a `providers.plan` it never
734
+ got before, with an empty `currentPlanHandle: ''` (no plan name/handle was
735
+ ever supplied to derive one from).
736
+
737
+ **Landed in** `0.10.5`. **Fail-closed in** n/a — a previously-dropped signal
738
+ is now included; nothing that resolved before stops resolving.
739
+
740
+ **Proving test:** `web-sdk/customer-side-trial-token-signal.test.ts` — a
741
+ trial-only local integration now gets a non-empty provider context with
742
+ `trialActive`/`trialDaysRemaining` set, and feeding those through
743
+ `derivePlacementPersonalizationTokens` + `resolveContent` renders
744
+ `{{trial_days_remaining}}` as `"3"` instead of leaving it literal. Includes
745
+ the positive control (trial + plan together — unchanged), the negative
746
+ control (no trial data at all — the token stays absent, never coerced to
747
+ `"0"`), and a sibling check confirming usage-only integrations were already
748
+ unaffected by the guard.
749
+
750
+ ---
751
+
752
+ ## 0.10.4
753
+
754
+ ### Every payload is a selection candidate, not just the first (BL-0122)
755
+
756
+ **What changed.** A placement's payloads are now *all* candidates on both
757
+ selection paths, in all three ports. Previously each port considered exactly one
758
+ payload per placement — TypeScript took `payloads[0]`, Python and Rust the first
759
+ payload with `status == "active"` — so payloads 2+ were never candidates and
760
+ their `target.segment_chips` could not be evaluated at all.
761
+
762
+ | | Before | After |
763
+ |---|---|---|
764
+ | Candidacy | one payload per placement | every payload (Python/Rust: every `active` payload) |
765
+ | `target.segment_chips` on payloads 2+ | never evaluated | evaluated per payload |
766
+ | Drag precedence | a pre-filter — it chose the only candidate | a tiebreaker among the payloads the user **matches** |
767
+ | Direct lookup by name/id | mapped a name to one payload | maps a name to every payload, gated individually, first eligible wins |
768
+
769
+ The contract this restores is
770
+ [`placement-prioritization.md`](https://github.com/revt-eng/revturbine-devkit/blob/main/docs/specs/scaffold/placement-prioritization.md)
771
+ §1 stage 3 — "Targeting — the user's plan and segment match **a payload**" — with
772
+ §4 and Appendix D scoping drag precedence to payloads that are equally eligible.
773
+
774
+ **Why it mattered.** A placement holding an admin payload and a member payload
775
+ gave every member either the admin copy (when payload 1 was unchipped) or
776
+ nothing at all (when payload 1 was chipped to admins). An integration hit the
777
+ second shape on 0.7.13 and concluded config-driven segmentation was inert. Plan
778
+ 233 TASK-7 had already made the chip predicate real — but the predicate was only
779
+ ever asked about one payload.
780
+
781
+ **Landed in.** 0.10.4 (all three ports, plus `@revt-eng/core` 0.1.326).
782
+
783
+ **Fail-closed in.** 0.10.4 — the same release. There is no tolerance window:
784
+ a user who matches no payload now receives `visible: false` with
785
+ `segment_target_mismatch` rather than payload 1's content.
786
+
787
+ **Proving test.** `tests/parity/fixtures/segment_chip_payload_selection.json`
788
+ (cross-language), plus `local-resolver-payload-selection.test.ts`,
789
+ `server-python/tests/placements/test_payload_selection.py` and
790
+ `server-rust/tests/payload_selection.rs` — each exercising **both** the slot and
791
+ the direct-lookup path, because gating one and not the other is exactly the back
792
+ door plans 138 and 233 each had to close.
793
+
794
+ **Who is affected.** Any Playbook authoring more than one payload on a
795
+ placement where payload 1 is not the payload a given user matches. Those users
796
+ now see the payload their chips select — which is the fix, and is a live
797
+ behaviour change for such configs. Single-payload placements are unaffected.
798
+
799
+ ---
800
+
801
+ ## 0.10.3
802
+
803
+ ### The Rust port gains the decision surfaces Python already shipped (BL-0145)
804
+
805
+ **What changed.** `RevTurbineCustomerSdk` on the Rust port (`revturbine`,
806
+ crates.io) now exposes the same decision surfaces the Python port exposes.
807
+ Nothing on the TypeScript or Python side changes; this is a Rust-only,
808
+ purely additive release.
809
+
810
+ | Added | Shape |
811
+ |---|---|
812
+ | `RevTurbineCustomerSdk::can(handle, context)` | The advertised alias of `check_entitlement`, matching the scaffold SDK function surface (canonical `checkEntitlement`, alias `can`). |
813
+ | `RevTurbineCustomerSdk::get_eligible_plans()` | `Vec<EligiblePlan>` — public, segment-eligible plan variations. |
814
+ | `RevTurbineCustomerSdk::get_eligible_addons()` | `Vec<EligibleAddon>` — the add-on twin. |
815
+ | `RevTurbineCustomerSdk::evaluate_trial_status(instances, now_iso, base_plan_handle, usage_balances)` | `TrialEvaluation`, reading `free_trial_rules` / `reverse_trial_rules` from the constructed Playbook. |
816
+ | `revturbine::format_currency_minor_units(amount, currency, locale)` | Free function, because Python exposes it as a module function. |
817
+ | `revturbine::plans` | New module carrying the catalog eligibility port and the formatter. |
818
+ | `UserContext::segment_ids` | Pre-resolved segment ids the catalog methods match against. |
819
+
820
+ `UserContext` gains a field but derives `Default`, so existing construction
821
+ with `..Default::default()` keeps compiling.
822
+
823
+ **Why it was invisible.** The cross-language parity gate was green on the
824
+ catalog and currency scenarios only because the Rust parity runner
825
+ *reimplemented* `eligible_catalog` and `format_currency_minor_units` inline
826
+ rather than calling the crate — so the comparison never touched shipped code,
827
+ and the crate could lack the capability entirely without a single fixture
828
+ going red. The runner now calls `revturbine::plans`, and the inline copies are
829
+ deleted; all 102 comparisons stay byte-identical.
830
+
831
+ ---
832
+
833
+ ## 0.10.2
834
+
835
+ ### Local mode resolves placements by slot id (BL-0119)
836
+
837
+ **What changed.** In `local_only` mode the browser SDK now resolves a placement
838
+ request against the Playbook's authored `placement_slots[]` registry.
839
+ `getPlacement({ slotId })` — with or without a `componentType` — previously
840
+ returned `null` for a slot the Playbook declared, and a controller/`usePlacement`
841
+ mount of that slot resolved to `placement_not_found`. Looking the same placement
842
+ up by **name** worked, which is what made this look like a config problem rather
843
+ than an SDK one.
844
+
845
+ Two things were missing, and both are now in place:
846
+
847
+ - **`registerSurfaceSlot()` adopts the declared template.** `surface_template_ids`
848
+ on the registered record is what puts the shared resolver on its slot branch,
849
+ where `trigger.slot_id` is matched. Without it the resolver fell back to direct
850
+ lookup, which is keyed by placement **name**/id and therefore can never match a
851
+ slot id — hence `placement_not_found`. An id passed explicitly at the call site
852
+ still wins; the mounting code knows what it renders.
853
+ - **`getPlacement()` falls through to the slot registry.** The local placement
854
+ cache only holds slots a decision has already run through, so a cold lookup
855
+ found nothing and stopped. It now derives the record from `placement_slots`,
856
+ matching on `id` and falling back to `surface_type` when only a component type
857
+ is given — the same derivation scaffold's headless
858
+ `LocalRuntime.slotRecordForConfig` has always performed. Registration on this
859
+ path is local only: reading a placement never writes a surface slot back to the
860
+ control plane.
861
+
862
+ This closes a browser-versus-headless divergence: the same Playbook decided
863
+ differently depending on which runtime read it. No public API change — no
864
+ signature moved, and nothing new is asked of the caller. A slot id that no
865
+ `placement_slots` entry declares still resolves to `null`, unchanged.
866
+
867
+ **Landed in** `0.10.2`. **Fail-closed in** n/a — a previously-`null` lookup now
868
+ returns the placement the Playbook authored.
869
+
870
+ **Proving test:** `web-sdk/local-slot-id-lookup.test.ts` — by-slot-id and
871
+ by-slot-id-plus-component-type both resolve, the controller path no longer
872
+ reports `placement_not_found`, an undeclared slot id still returns `null` and
873
+ gains no invented template, an explicit `surfaceTemplateIds` still wins, and the
874
+ by-name lookup that always worked keeps working (the positive control).
875
+
876
+ ---
877
+
878
+ ## 0.10.1
879
+
880
+ ### Treatment interactions carry the identified `account_id`
881
+
882
+ **What changed.** Every treatment interaction the SDK sends to
883
+ `/api/events/interactions` — the impression that writes a
884
+ `placement_presentations` row, plus dismiss / click / conversion — now carries
885
+ `account_id`, taken from the account the integration identified
886
+ (`identify(userId, { account_id })` / `setUserContext`). It was never sent at
887
+ all, so the ingest route's `account_id ?? user_id` fallback stamped a **user**
888
+ id into an **account** column. `placement_presentations.account_id` is a join
889
+ key, not a label: `monetization_funnel` matches it against account ids from
890
+ `events_clickstream` / `events_billing`, and every experiment summary pipe
891
+ reads it when `analysis_unit='account'`. Those joins therefore matched only
892
+ where a user id happened to equal an account id — and an account-grain
893
+ experiment readout returned the user-grain n while looking perfectly valid.
894
+
895
+ Two details make it a usable key. The value is PII-redacted **identically to
896
+ `/api/track`**, so an email-shaped account id becomes the same hash in
897
+ `placement_presentations` and in `events_clickstream` and the funnel actually
898
+ joins. And when no account was identified the field is **omitted**, never set
899
+ to the user id — the route keeps its own fallback for SDKs that have not
900
+ upgraded, but a wrong join key is worse than a missing one.
901
+
902
+ No public API change: nothing new is asked of the caller, and
903
+ `RevTurbineTreatmentInteractionInput` is unchanged. Integrations that already
904
+ pass `account_id` to `identify()` get correct account-grain analytics with no
905
+ code change; integrations that never identify an account are unaffected on the
906
+ wire and see the same route-side fallback as before.
907
+
908
+ **Landed in** `0.10.1`. **Fail-closed in** n/a — additive; nothing old is
909
+ rejected.
910
+
911
+ **Proving test:** `web-sdk/interaction-wire-contract.test.ts` — "the account
912
+ identity the analytics joins key on": the identified account reaches the wire
913
+ distinct from `user_id`, an unidentified one is omitted rather than copied from
914
+ `user_id`, an email-shaped account id matches the `/api/track` lane
915
+ byte-for-byte, and a re-queued batch keeps the account that was acting when
916
+ each interaction happened.
917
+
918
+ ---
919
+
920
+ ## 0.10.0
921
+
922
+ ### `publicKey` is the browser credential; `apiKey` is the server key
923
+
924
+ **What changed.** The browser init option for the ingest (public) key is
925
+ `publicKey` — on `initRevTurbine`, `<RevTurbineProvider options>`, and the
926
+ headless init alike. Every browser bearer (ingest, launched-Playbook delivery,
927
+ user context, branding, trial status) uses that one key. `apiKey` now means
928
+ one thing everywhere: the secret **server key**, as it always did on
929
+ `@revturbine/sdk/server` — pass it from backend code only (a route handler
930
+ using `@revturbine/sdk/headless` keeps using `apiKey`). The name states what the
931
+ credential is at the call site: a security scanner or an agent that meets
932
+ `publicKey` in a bundle knows it belongs there, where `apiKey` reads as a leak.
933
+
934
+ `apiKey` and `ingestPublicKey` are still accepted on a browser init as aliases
935
+ of `publicKey` for one minor (precedence: `publicKey`, then `ingestPublicKey`,
936
+ then `apiKey`). Using an alias without `publicKey` in a browser logs a one-time
937
+ development warning naming `publicKey`; production builds are silent. On the
938
+ browser `RevTurbineInitOptions` type, `apiKey` is now optional (it was required)
939
+ and `ingestPublicKey` is `@deprecated`. Keyless local-only init is unchanged,
940
+ and the plan 95 anonymous `sdk_init` beacon still fires only when no public key
941
+ (`publicKey` or `ingestPublicKey`) was supplied.
942
+
943
+ Ruling: Kent, 2026-09-21, devkit PR #808 (closed).
944
+
945
+ **Landed in** `0.10.0`. **Fail-closed in** `0.11.0` — `ingestPublicKey` was
946
+ removed from the options type and `apiKey` stopped being read as a browser
947
+ credential (BL-0113); see the `0.11.0` entry above.
948
+
949
+ **Proving test:** `web-sdk/public-key-option.test.ts` — precedence, the single
950
+ bearer across ingest and control-plane fetches, the browser-only warning, and
951
+ the keyless local-only init. Type-level: `web-sdk/init-options-exactness.test-d.ts`
952
+ accepts `publicKey` and rejects the `publickey` casing typo.
953
+
954
+ ### `endpoint` and `mode` are optional on `initRevTurbine` and `<RevTurbineProvider>`
955
+
956
+ **What changed.** `RevTurbineInitOptions.endpoint` defaults to
957
+ `https://revturbine.com/app` (`DEFAULT_HOSTED_ENDPOINT`, exported) and
958
+ `RevTurbineInitOptions.mode` defaults to `'snippet'` (`DEFAULT_SDK_MODE`,
959
+ exported); `<RevTurbineProvider>` passes `'react'` when the app does not set it.
960
+ Both were required; `mode` only ever labelled telemetry (`page_view.mode` and a
961
+ diagnostics message), and every hosted integration used the same endpoint.
962
+ Existing calls that pass them are unchanged. Local mode is unchanged (its
963
+ placeholder defaults already applied). Additive, no version bump required.
964
+
965
+ **Landed in** `0.10.0`. **Fail-closed in** n/a — nothing old is rejected.
966
+
967
+ **Proving test:** `web-sdk/public-init.test.ts` — "defaults endpoint and mode
968
+ for a hosted init that omits them".
969
+
970
+ ### Reason-code compatibility verification
971
+
972
+ Added a reviewed baseline for 27 entitlement and 21 placement reason values,
973
+ checked against live SDK/core fixtures. Removal/rename controls exercise every
974
+ protected value, and baseline changes require this changelog to change through
975
+ the existing public-API gate. Custom provider reasons remain extensible and
976
+ free-form diagnostics are excluded. This adds verification only; no runtime
977
+ reason values or package versions change.
978
+
979
+ Proving tests: `web-sdk/reason-contract.test.ts` and
980
+ `web-sdk/reason-contract-policy.test.ts`. The intentional-change procedure is
981
+ in `docs/reason-code-contract.md`.
982
+
983
+ ## 0.9.3
984
+
985
+ ### Fixed
986
+
987
+ - Placement explanations use the same published segment-eligibility helper as
988
+ decisions, keeping OR-within-segments and AND-with-plan behavior aligned.
989
+ The explanation/decision matrix covers local and provider-backed Playbooks,
990
+ unknown or missing segments, exact handle matching and plan-filter combinations.
991
+
992
+ ## 0.9.2
993
+
994
+ ### Public initializer user context
995
+
996
+ `await initRevTurbine({ user: { id, ...context }, ...options })` from
997
+ `@revturbine/sdk` or `@revturbine/sdk/headless` now passes `id` only as the
998
+ identity argument. Supported user context retains its existing behavior without
999
+ the spurious unrecognized-context-key warning for `id`; genuinely unknown keys
1000
+ still warn. Public quick starts now show the awaited `SdkSession` and
1001
+ `session.sdk.getBranding()`. The separate synchronous core initializer is unchanged.
1002
+
1003
+ Proving tests: `web-sdk/public-init.test.ts` and the installed public-package
1004
+ runtime/type examples in `web-sdk/scripts/check-public-diagnostics.mjs`.
1005
+
1006
+ ## 0.9.1
1007
+
1008
+ ### Public changelog distribution
1009
+
1010
+ The maintained changelog is now included as `CHANGELOG.md` in the npm package
1011
+ and mirrored at the root of the public SDK repository. The docs Reference
1012
+ navigation links directly to that authoritative public file. The independent,
1013
+ hidden docs copy has been retired. The pre-0.3.0 history gap below remains;
1014
+ this release does not reconstruct it. No SDK runtime behavior changed.
1015
+
1016
+ ## 0.9.0
1017
+
1018
+ ### Placement eligibility follows current context after conversion
1019
+
1020
+ - **What changed** — Conversion remains an analytics event and no longer retires
1021
+ or temporarily suppresses a placement. Legacy conversion-owned browser state
1022
+ is ignored. Supply the updated UserContext after a plan change; Playbook
1023
+ targeting determines whether the offer still applies.
1024
+ - **What changed** — Fixed and Access Gate placements bypass dismissal, reminder
1025
+ and bare-click cooldowns. Dismiss and snooze close the current display; the
1026
+ next explicit trigger, refresh or mount evaluates again. This uses the resolved
1027
+ placement category, including when another category renders inside a Fixed slot.
1028
+ Other categories retain authored/default windows, and explicit system
1029
+ suppression and entitlement denial remain effective.
1030
+ - **Landed in** — `0.9.0` across JavaScript, Python and Rust.
1031
+ - **Fail-closed in** — Not applicable; no input shape was removed. Rust callers
1032
+ constructing `InteractionState` literals should supply the new optional
1033
+ `explicit_suppressed_until` field or use `..Default::default()`.
1034
+ - **Proving test** — `web-sdk/conversion-eligibility.test.ts`,
1035
+ `web-sdk/placements/FixedSurfaceSlot.dismissal.test.tsx`, and the shared
1036
+ `placement_category_interactions` parity fixture.
1037
+
1038
+ ## 0.8.9
1039
+
1040
+ ### JavaScript: development diagnostics survive package minification
1041
+
1042
+ - **What changed** — The SDK package preserves the environment check until the
1043
+ consuming application builds it. Previously the minified package baked in
1044
+ production mode, hiding the React initialization-failure banner, app-theme
1045
+ override warning and legacy-theme warning even in development applications.
1046
+ Production applications still suppress those development diagnostics;
1047
+ `initStatus` and required initialization-error reporting remain available.
1048
+ The existing fallback for browsers without `process` is preserved.
1049
+ - **Landed in** — `0.8.9`.
1050
+ - **Fail-closed in** — Not applicable; no decision or initialization policy changes.
1051
+ - **Proving test** — `web-sdk/scripts/check-public-diagnostics.mjs` installs the
1052
+ public tarball and runs Chromium against separate development, production
1053
+ and environment-preserving consumer bundles. The PR release-build gate
1054
+ retains the tarball, inventory, SHA-256 and observed diagnostics.
1055
+
1056
+ Python and Rust receive the matching version bump; their behavior is unchanged.
1057
+
1058
+ ## 0.8.8
1059
+
1060
+ Behavioural fixes in Python; a new decision surface in Rust.
1061
+
1062
+ ### Python: numeric coercion unified onto JS Number() semantics
1063
+
1064
+ - **What changed** — `parse_numberish`'s string branch used Python
1065
+ `float()`, which accepts forms JS `Number()` rejects (underscore
1066
+ separators: `"1_000"` scored 1000 here, NaN->0 in TypeScript — a
1067
+ candidate-flipping divergence in every selection scorer) and rejects
1068
+ forms JS accepts (`"0x10"` is 16). The one JS-semantics parser from the
1069
+ plan-233 segments port is promoted to `helpers.js_number` and every
1070
+ coercion site shares it. Ripple alignments: `Number("")` is 0 (the old
1071
+ is-None assertion pinned the float() behaviour), a whitespace-only
1072
+ `template_version` resolves to `"0"` exactly as TS does, and
1073
+ `superseded_versions` no longer fabricates a `"0"` entry from an empty
1074
+ string (mirrors TS's trim-then-filter).
1075
+
1076
+ ### Rust: the candidate-selection layer, ported
1077
+
1078
+ - **What changed** — `resolve_local_placement_from_candidates` plus the
1079
+ full helper set (category buckets, plan-53 two-stage tier-3 urgency,
1080
+ milestone supersession, category conflict suppression, server-order
1081
+ dominance) now exists in Rust (`placements/selection.rs`). Until now the
1082
+ Rust port selected by entry order only; competing-category selections
1083
+ had no third side, which is why plan 234 TASK-15's fixture was deferred.
1084
+ - **Proving test** — parity fixture `placement_selection_priority`
1085
+ (10 calls: cross-tier dominance, both tier-3 stages including a
1086
+ class-vs-proximity disagreement, retention/conversion tie, server_order
1087
+ skipping conflict suppression, fixed_only, milestone supersession, both
1088
+ REQ-5 coercion lanes, output_id tiebreak), byte-identical ts/py/rs on
1089
+ its first regen, plus mirrored port-local suites in Python and Rust.
1090
+
1091
+ ## 0.8.7
1092
+
1093
+ No runtime behaviour change in any port; the release carries new parity
1094
+ locks and one serde derive.
1095
+
1096
+ ### All ports: trial-status derivation and allocation scoping parity-locked
1097
+
1098
+ - **What changed** — two decision surfaces every runtime already evaluated
1099
+ gained their first cross-language locks. `evaluateTrialStatus` (the
1100
+ free/reverse trial-rule derivation): the TS golden vectors mirrored the
1101
+ Python unit suite by hand-maintained convention, and Rust was never in
1102
+ the mirror at all; the `trial_status_evaluation` fixture makes the
1103
+ agreement a byte-checked property. `computeConsumedPercent` (the spec
1104
+ 3.4 Pooling allocation-scoped grant selection): reachable from no
1105
+ placement fixture because the static provider has no grants lane; the
1106
+ `threshold_allocation_scoping` fixture drives every allocation label
1107
+ against a hierarchy whose levels carry DIFFERENT counters.
1108
+ - **A wire divergence caught on first regen** — the reverse-trial grants
1109
+ set serialized three different ways (TS `JSON.stringify(Set)` = `{}`
1110
+ with the contents silently lost; Python's canonicalizer dropped the key;
1111
+ Rust emitted the honest list). The runners now own the wire form: a
1112
+ sorted array on every side.
1113
+ - **Fail-closed in** — no evaluator changed; `TrialEvaluation` gained a
1114
+ `Serialize` derive in Rust (additive).
1115
+ - **Proving test** — parity fixtures `trial_status_evaluation` (6 calls;
1116
+ the usage-lane call was sharpened after the first cut put
1117
+ `trial_limit_type` on the RULE and every side agreed on `time` - the
1118
+ non-discriminating shape REQ-3 forbids; it rides the INSTANCE) and
1119
+ `threshold_allocation_scoping` (9 calls).
1120
+
1121
+ ## 0.8.6
1122
+
1123
+ One capability lands in the two ports; TypeScript is unchanged and ships this
1124
+ version for lockstep alone.
1125
+
1126
+ ### Python + Rust: targeting-state derivation ported (buildTargetingState)
1127
+
1128
+ - **What changed** — `LocalRuntime.build_targeting_state` raised
1129
+ NotImplementedError in Python (a REQ-14 deferral) and had no Rust port at
1130
+ all, so the derivation from a raw user context to the traits segment
1131
+ evaluation consumes existed only in TypeScript: segment parity proved
1132
+ "agrees given the same traits", never "agrees given the same user
1133
+ context". Both ports now carry the pure derivation
1134
+ (`core.user_context.build_targeting_state` / `user_context.rs`), byte-
1135
+ locked against the TS canonical.
1136
+ - **Also aligned red-first** — Python's dormant
1137
+ `configured_plan_name_from_exported_config` (no callers until now) still
1138
+ carried pre-plan-120 semantics: id matching, plan-object resolution, and
1139
+ a `_handle` suffix fallback. Plans resolve by `unique_handle` alone; the
1140
+ drift-pinning tests were corrected with the alignment.
1141
+ - **Fail-closed in** — identity rules are shadow-proof by construction:
1142
+ `plan_handle` is a reserved trait a `custom.plan_handle` can never
1143
+ impersonate, and no identity means the reserved trait is REMOVED and the
1144
+ effective plan omitted.
1145
+ - **Proving test** — parity fixture `targeting_state_derivation` (6 calls:
1146
+ identity precedence, shadow-proofing, plan-OBJECT fallback, the id that
1147
+ must resolve nothing, the no-identity removal, override-wins usage with a
1148
+ legacy bare-number entry), byte-identical ts/py/rs, plus the corrected
1149
+ unit matrices in both ports.
1150
+
1151
+ ## 0.8.5
1152
+
1153
+ One behavioural alignment, Python only. TypeScript and Rust are unchanged and
1154
+ ship this version for lockstep alone.
1155
+
1156
+ ### Python: category buckets and tier-3 urgency aligned to the plan-53 model
1157
+
1158
+ - **What changed** — this port's `category_bucket` carried the pre-plan-53
1159
+ map for months (trial=3, retention=5 where the canonical folds trial into
1160
+ priority tier 3 as bucket 2 and retention into the single discretionary
1161
+ bucket 4); its docstring cited source lines that had moved AND changed
1162
+ upstream. The map feeds the selection comparator, so a trial and a usage
1163
+ placement competing for one surface ordered STRICTLY here (usage always
1164
+ first) while the canonical ties them and applies the plan-53 two-stage
1165
+ urgency model — which this port also lacked. `tier3_class` is now ported
1166
+ and staged ahead of proximity in `resolve_local_placement_from_candidates`,
1167
+ the map matches the canonical, and the system-caps exemption boundary moved
1168
+ from the compensating `<= 3` to the canonical `<= 2` (the exempted category
1169
+ set is unchanged).
1170
+ - **Landed in** — `helpers.category_bucket` / `helpers.tier3_class`, the
1171
+ comparator in `placement_decision.py`, and the caps exemption boundary.
1172
+ - **Fail-closed in** — no gate changes; this is ordering. Exemptions and
1173
+ discretionary classification are set-identical before and after.
1174
+ - **Proving test** — `tests/placements/test_selection_tier3.py` (class
1175
+ ordering with class-vs-proximity DISAGREEMENT cases; mutation-checked:
1176
+ disabling the tier3 stage fails exactly the two stage-1 tests), plus the
1177
+ bucket-map matrix in `test_helpers.py` whose old strict `usage < trial`
1178
+ invariant was pinning the drift. The cross-language fixture for this
1179
+ surface lands with the Rust selection-layer port (plan 234 TASK-8).
1180
+
1181
+ ## 0.8.4
1182
+
1183
+ One behavioural alignment, Python only. TypeScript and Rust are unchanged and
1184
+ ship this version for lockstep alone.
1185
+
1186
+ ### Python: cap/cooldown maths consolidated onto the shared primitive
1187
+
1188
+ - **What changed** — `placement_decision.py` and `cap_enforcer.py` carried
1189
+ their own copies of the cap-window and cooldown arithmetic that TypeScript
1190
+ consolidated onto `evaluateCaps` (plan 233 TASK-15 / scaffold #351). Both
1191
+ now delegate to the new `cap_rules.evaluate_caps` port. Reading the bodies
1192
+ side by side surfaced two silent divergences, both aligned to the TS
1193
+ canonical: Fixed / Access-Gate categories are now exempt from per-payload
1194
+ caps in `check_placement_caps` (TS has exempted them since plan 167; this
1195
+ port capped them), and a cap deny now persists the UNFILTERED state — the
1196
+ old bodies trimmed `seen_at` to the tripping window (one comment claimed
1197
+ "Mirrors TS"; TS does no such trim), silently shrinking future week/month
1198
+ windows.
1199
+ - **Landed in** — `core/placements/cap_rules.py` (the primitive),
1200
+ `check_placement_caps` / `check_system_presentation_caps` /
1201
+ `CapEnforcer.enforce` (the delegations).
1202
+ - **Fail-closed in** — verdicts only ever tighten or stay: the exemption
1203
+ affects categories that are user-prompted by design, and the state
1204
+ alignment preserves more history, never less.
1205
+ - **Proving test** — `tests/placements/test_cap_delegation.py`: a 12-case
1206
+ characterization matrix green before AND after the refactor, the two
1207
+ aligned behaviours run RED against the pre-refactor body, and a mutation
1208
+ of the shared window arithmetic fails four tests across both entry points
1209
+ (the shared maths is reached, not shadowed).
1210
+
1211
+ ## 0.8.3
1212
+
1213
+ One behavioural fix, Rust only. TypeScript and Python are unchanged and ship
1214
+ this version for lockstep alone.
1215
+
1216
+ ### Rust: a confirmed conversion did not retire the placement
1217
+
1218
+ - **What changed** — the Rust port carried the full ImpressionHistory
1219
+ machinery (`record_conversion`, `is_hidden_sync`, the retired cache) since
1220
+ the port landed, but its placement resolver never consulted it. A user who
1221
+ completed a placement's CTA — a confirmed conversion — kept seeing that
1222
+ placement in this port alone, while TypeScript core
1223
+ (`local-resolver.ts:610-612`, `:726`) and Python both hide it permanently.
1224
+ This is the defect class plan 167's unshipped follow-up became as a
1225
+ customer P1: paying customers shown the upsell they already bought.
1226
+ - **Landed in** — the retirement gate is wired at both decision lanes: the
1227
+ candidate filter (before the trigger gates, mirroring the TS order) and
1228
+ the direct-lookup path, which now answers `placement_retired`, keyed by
1229
+ the output's `rule_id` exactly as TS core and Python key it.
1230
+ - **Fail-closed in** — the gate only ever hides; an empty or cold history
1231
+ changes nothing, and a placement with no recorded conversion is untouched.
1232
+ - **Proving test** — parity fixture `placement_conversion_retires`
1233
+ (visible -> convert -> `placement_retired`, with an untouched control
1234
+ staying visible, byte-identical across ts/py/rs; mutation-checked: making
1235
+ the Rust gate inert diverges the snapshot) and
1236
+ `server-rust/tests/local_runtime.rs`
1237
+ (`a_confirmed_conversion_permanently_retires_the_placement`).
1238
+
1239
+ ## 0.8.2
1240
+
1241
+ One behavioural fix, Rust only. TypeScript and Python are unchanged and ship
1242
+ this version for lockstep alone.
1243
+
1244
+ ### Rust: provider-path rule selection was source-order, not most-permissive
1245
+
1246
+ - **What changed** — on the provider path (`check_entitlement` with a rules
1247
+ provider, the path a static config registers), the Rust port's §2.6.5
1248
+ most-permissive selection scored each rule snapshot's root object instead
1249
+ of its `fields` sub-object, where the adapter actually nests the score keys
1250
+ (`limit_value`, `allowance`, `included_count`, `enabled`). Every rule
1251
+ scored 0, so the deterministic tie-break — earliest in source order —
1252
+ silently decided instead. Concretely: an entitlement carrying both a seat
1253
+ rule (listed first) and a `usage_limit` rule at limit 2 returned **allowed**
1254
+ at `used: 3` where TypeScript and Python return limited
1255
+ (`usage_limit_reached`). Whether you were affected depends on rule order in
1256
+ your Playbook, which is what made this silent. The ExportedConfig fallback
1257
+ path (`derive_local_entitlement_from_configured_rules`) was NOT affected —
1258
+ it passes the merged type-fields bag and scored correctly.
1259
+ - **Landed in** — `0.8.2`.
1260
+ - **Fail-closed in** — `0.8.2` (same release; no tolerated window).
1261
+ - **Proving test** — parity fixture `entitlement_rule_seat_included_count`
1262
+ (byte-locked ts ≡ py ≡ rs; diverged on exactly the shadowed-limit call until
1263
+ the fix) and `most_permissive_scores_the_fields_sub_object_not_the_snapshot_root`
1264
+ (Rust unit, mutation-checked). The pre-existing Rust unit test had authored
1265
+ its score key at the snapshot root — a shape the adapter never emits — and
1266
+ passed over the bug; it now uses the production shape.
1267
+
1268
+ ---
1269
+
1270
+ ## 0.8.1
1271
+
1272
+ One behavioural fix, Python and Rust only. The TypeScript SDK is unchanged and
1273
+ ships this version for lockstep alone.
1274
+
1275
+ ### Python/Rust: cross-dimension segment AND no longer degrades to flat OR
1276
+
1277
+ - **What changed** — the config evaluator's segment→dimension lookup was keyed
1278
+ by the segment's `id` in the Python and Rust ports, where the TypeScript
1279
+ canonical keys it by `handle`. Rule `segment_ids` are handle-valued, so on
1280
+ any Playbook whose segment ids differ from their handles — every real
1281
+ export — the ports' lookups all missed, every rule segment collapsed into
1282
+ the uncategorised bucket, and a rule spanning two dimensions (which must
1283
+ require BOTH, intra-dimension OR + cross-dimension AND) matched on EITHER.
1284
+ Concretely: an entitlement rule scoped to `emea` (region) AND `admins`
1285
+ (role) **granted** a user who was only in `emea`. It now denies, matching
1286
+ the TypeScript SDK. If your integration passes a non-empty user segment set
1287
+ to `derive_local_entitlement_from_configured_rules` and relies on a
1288
+ cross-dimension rule, users who matched only one dimension lose the grant
1289
+ on upgrade — that is the fix working. The built-in runtime fallback path
1290
+ passes an empty segment set and is unaffected.
1291
+ - **Landed in** — `0.8.1`.
1292
+ - **Fail-closed in** — `0.8.1` (same release; no tolerated window).
1293
+ - **Proving test** — parity fixtures `entitlement_segment_dimensions` /
1294
+ `entitlement_segment_no_dim_bucket` (byte-locked TS ≡ Python ≡ Rust; the
1295
+ regen diverged on exactly the cross-dimension calls until the fix), plus
1296
+ `TestSegmentDimensionLookup` (Python) and `cross_dimension_and_*` (Rust).
1297
+
1298
+ ## 0.8.0
1299
+
1300
+ Plan 233 remediated four escalated defect families, and this is the release that
1301
+ delivers them. Everything below sat merged on `main` and unpublished for the
1302
+ length of that plan — 20 commits, twelve breaking changes — because the version
1303
+ never moved off `0.7.13`.
1304
+
1305
+ **Read this section before upgrading from `0.7.x`.** Three of these change live
1306
+ behaviour rather than only types: segment-targeted payloads stop showing to
1307
+ users outside the segment, `sdk.dismiss()` starts writing suppression where it
1308
+ previously did nothing, and a converted placement stops coming back. Each is the
1309
+ fix working, and each is visible to your users the moment you upgrade.
1310
+
1311
+ ### The `tenantId` init option is now the authority over a Playbook's `tenant_id`
1312
+
1313
+ - **What changed** — the Playbook's `tenant_id` used to win, and the init option
1314
+ was a fallback applied only to legacy artifacts. That combination killed every
1315
+ integration that served a canonical Playbook *and* passed the tenant at init:
1316
+ the artifact had no `tenant_id` to win with, and the option was withheld
1317
+ because the artifact was canonical, so init threw. The init option now wins.
1318
+ The artifact's `tenant_id` is a **guard** — it exists so the CLI can refuse to
1319
+ upload a config to the wrong tenant — and on a mismatch the SDK warns, naming
1320
+ both values, and proceeds. It never fails init.
1321
+ - **Landed in** — `0.8.0`
1322
+ - **Fail-closed in** — n/a. This change makes init *succeed* where it used to
1323
+ throw. The old behaviour was the failure.
1324
+ - **Proving test** — `web-sdk/config-target-precedence-init.test.ts`
1325
+
1326
+ ### Unrecognized and missing init options are compile errors
1327
+
1328
+ - **What changed** — init options are exact-checked. A typo (`apikey` for
1329
+ `apiKey`) or a stale option is a type error rather than a value the SDK
1330
+ silently ignores. This catches the case TypeScript's excess-property check
1331
+ never saw: options assembled in a variable, or in an un-annotated `useMemo`,
1332
+ which is exactly how React integrations build them.
1333
+ - **Landed in** — `0.8.0`
1334
+ - **Fail-closed in** — same. Unknown keys were ignored at runtime before and
1335
+ still are; what changed is that you cannot write them.
1336
+ - **Proving test** — `web-sdk/init-options-exactness.test-d.ts`
1337
+
1338
+ ### A truncated Playbook is a compile error at the `localRuntime` boundary
1339
+
1340
+ - **What changed** — `UnvalidatedConfigArtifact` was `Record<string, unknown>`
1341
+ and now structurally requires the body arrays (`plans`, `entitlements`,
1342
+ `entitlement_rules`, `segments`, `content_ui_paths`). A Playbook missing one is
1343
+ now caught by `tsc` instead of throwing at init.
1344
+ - **Who this breaks** — only a caller who **explicitly annotated** their artifact
1345
+ `Record<string, unknown>`; that must now be narrowed. A JSON module import and
1346
+ a fetched artifact (`await res.json()`, typed `any`) both still compile with no
1347
+ cast.
1348
+ - **Landed in** — `0.8.0`
1349
+ - **Fail-closed in** — same version, at compile time. Runtime validation was
1350
+ already fail-closed and is unchanged.
1351
+ - **Proving test** — `web-sdk/playbook-structural.test-d.ts`
1352
+
1353
+ ### Init failure is observable without an SDK instance
1354
+
1355
+ - **What changed** — when init fails the provider used to log and render children
1356
+ anyway, so the SDK simply never started and every diagnostic probe was
1357
+ unreachable *in precisely the failure mode that matters most*. `initStatus` is
1358
+ now on the React context and is readable when the SDK instance is `null`, with
1359
+ a non-empty `remediation` string on every init-path error.
1360
+ - **Landed in** — `0.8.0`
1361
+ - **Fail-closed in** — same.
1362
+ - **Proving test** — `web-sdk/react/RevTurbineProvider.init-status.test.tsx`
1363
+
1364
+ ### The rendered theme resolves through the branding ladder
1365
+
1366
+ - **What changed** — `RevTurbineProvider` read `playbook?.theme` directly, so the
1367
+ `branding` init option never reached `useRevTurbineTheme()`. `getBranding()`
1368
+ and the rendered theme disagreed; that divergence *was* the defect. Both now
1369
+ resolve from the same rung.
1370
+ - **Landed in** — `0.8.0`
1371
+ - **Fail-closed in** — same.
1372
+ - **Proving test** — `web-sdk/react/RevTurbineProvider.branding-ladder.test.tsx`
1373
+
1374
+ ### `RevTurbineThemeProvider` merges partial themes, and an app-mounted one wins
1375
+
1376
+ - **What changed** — a partial theme replaced the defaults wholesale instead of
1377
+ merging, so supplying one token dropped every other. Partial themes now merge.
1378
+ Separately: if your app mounts its own `RevTurbineThemeProvider`, it wins over
1379
+ the SDK's internal default, and a conflict warns in development.
1380
+ - **Landed in** — `0.8.0`
1381
+ - **Fail-closed in** — same.
1382
+ - **Proving test** — `web-sdk/theme/ThemeContext.partial.test.tsx`,
1383
+ `web-sdk/react/RevTurbineProvider.theme-nesting.test.tsx`
1384
+
1385
+ ### Light/dark schemes no longer require re-initializing the SDK
1386
+
1387
+ - **What changed** — additive. A `colorScheme` option and `setColorScheme()` swap
1388
+ palettes while keeping SDK instance identity stable. The previous workaround
1389
+ was re-initializing the SDK, which discarded its state.
1390
+ - **Landed in** — `0.8.0`
1391
+ - **Fail-closed in** — n/a, additive.
1392
+ - **Proving test** — `web-sdk/react/RevTurbineProvider.color-scheme.test.tsx`
1393
+
1394
+ ### `segment_chips` are enforced in the decision path
1395
+
1396
+ - **What changed** — payload `segment_chips` were evaluated by
1397
+ `explainPlacementDecision` but **not** by the decision path itself, so the
1398
+ probe and the decision disagreed and a segment-targeted payload could show to a
1399
+ user outside the segment. Both now call one shared helper, in every port.
1400
+ - **Who this breaks** — an integration relying, knowingly or not, on
1401
+ segment-targeted payloads showing to everyone will now see them correctly
1402
+ restricted. **There is no grace period**: this was ruled a bug, not a behaviour
1403
+ change.
1404
+ - **Landed in** — `0.8.0`
1405
+ - **Fail-closed in** — same version, and in all three runtimes together.
1406
+ - **Proving test** — `tests/parity/fixtures/segment_chip_targeting.json` and
1407
+ `tests/parity/fixtures/segment_evaluation.json`, run byte-identical across
1408
+ TypeScript, Python and Rust.
1409
+
1410
+ ### Dismissal actually suppresses, at the authored window
1411
+
1412
+ - **What changed** — two defects. The interaction-state **read** omitted
1413
+ `treatmentId` while the **write** included it, and the controllers always
1414
+ populate it, so the keys could never match and dismissal suppression was dead
1415
+ for every React integration. And the window was a hardcoded 24-hour literal
1416
+ passed explicitly at every call site, which made both the authored
1417
+ `cooldown_after_dismiss_days` and the 7-day default unreachable. The window now
1418
+ resolves: explicit caller value → **authored config** → SDK default.
1419
+ `remind_later_minutes` resolves independently, so "remind me" no longer means
1420
+ "hide for a week".
1421
+ - **Who this breaks** — dismissal now suppresses where it previously did nothing.
1422
+ An integration that layered its own suppression on top may double-suppress.
1423
+ - **Landed in** — `0.8.0`
1424
+ - **Fail-closed in** — same. Note the *shape* of this one: it shipped in plan 167
1425
+ with a proving test that dismissed **without** a `treatmentId`, so both keys
1426
+ fell back to `'default'`, matched, and the feature appeared to work for a
1427
+ month.
1428
+ - **Proving test** — `web-sdk/customer-side-cooldown-suppression.test.ts`
1429
+
1430
+ ### A dismissal is no longer treated as "no match"
1431
+
1432
+ - **What changed** — `FixedSurfaceSlot` rendered its `fallback` whenever
1433
+ `!visible`, and dismissing sets `visible: false` — so closing a placement put
1434
+ the fallback back in the same space, a ghost replacing the thing just
1435
+ dismissed. A slot now distinguishes the two: no match still renders `fallback`;
1436
+ a dismissal renders nothing. `FixedSurfaceSlot` also gains `onDismissed`, and
1437
+ `MessageSurfaceSlot`'s `onDismissed` — a public prop whose handler was built
1438
+ and then discarded, so it could never fire — now works.
1439
+ - **Who this breaks** — a host working around the ghost (one integration used a
1440
+ `MutationObserver`) can remove the workaround. `MessageSurfaceSlot`'s
1441
+ `onDismissed` goes from never firing to firing.
1442
+ - **Landed in** — `0.8.0`
1443
+ - **Fail-closed in** — same.
1444
+ - **Proving test** — `web-sdk/placements/FixedSurfaceSlot.dismissal.test.tsx`
1445
+
1446
+ ### `convert()` retires the placement instead of only reporting it
1447
+
1448
+ - **What changed** — `convert()` emitted a `placement_interaction` event and
1449
+ stopped: it never wrote the terminal state, so **a user who converted kept
1450
+ being shown the upsell they had just paid for**. `dismiss()` and `snooze()` had
1451
+ the identical report-but-never-act shape. All three now route through
1452
+ `trackTreatmentInteraction`.
1453
+ A second defect sat behind the same symptom: nothing in the decision path ever
1454
+ *read* the terminal state. `isRetired` was written by `recordConversion` and
1455
+ had no caller, so a 5-minute transient window was the only thing hiding a
1456
+ converted placement — the upsell returned five minutes after checkout even
1457
+ through the controller path. `getPlacementDecision` now checks retirement and
1458
+ answers `retired_by_conversion`.
1459
+ - **Who this breaks** — `sdk.dismiss()` now writes suppression state where it
1460
+ previously did nothing.
1461
+ - **Landed in** — `0.8.0`
1462
+ - **Fail-closed in** — same.
1463
+ - **Proving test** — `web-sdk/convert-retires-placement.test.ts`
1464
+
1465
+ ### New: a slot-inventory probe
1466
+
1467
+ - **What changed** — additive. `sdk.getRegisteredSlots()` returns the slots this
1468
+ app has mounted, and `sdk.diagnoseSlotInventory()` diffs them against the
1469
+ Playbook's placement triggers in both directions. A placement targeting a slot
1470
+ no code mounts **can never show** and nothing reported it; a config-side audit
1471
+ cannot see call sites.
1472
+ - **Landed in** — `0.8.0`
1473
+ - **Fail-closed in** — n/a, additive and diagnostic.
1474
+ - **Proving test** — `web-sdk/slot-inventory-probe.test.ts`
1475
+
1476
+ ---
1477
+
1478
+ ## 0.7.0
1479
+
1480
+ ### `soft_block` → `block_with_upsell`
1481
+
1482
+ - **What changed** — the enforcement mode `soft_block` was renamed to
1483
+ `block_with_upsell`, and with it the reason codes the SDKs return:
1484
+ `usage_limit_reached_soft_block` → `usage_limit_reached_block_with_upsell`, and
1485
+ `credit_balance_exhausted_soft_block` → `credit_balance_exhausted_block_with_upsell`.
1486
+ **Any integration branching on the old reason string stops matching.**
1487
+ - **Landed in** — `0.7.0`
1488
+ - **Fail-closed in** — n/a. Behaviour is unchanged, and `soft_block` is still
1489
+ accepted wherever it appears in an already-compiled Playbook, decoding to
1490
+ exactly the decision it always made. Existing payloads keep working without
1491
+ recompilation; only the **string you match on** moved.
1492
+ - **Proving test** — the cross-language parity corpus (`tests/parity/`), which
1493
+ asserts the reason codes byte-identically across all three runtimes.
1494
+
1495
+ ---
1496
+
1497
+ ## 0.6.0
1498
+
1499
+ ### The server-side decision methods are gone
1500
+
1501
+ - **What changed** — removed `RevTurbineServer.evaluate` / `getPlacement` /
1502
+ `checkEntitlement` / `can` / `getTrialStatus` (Node), and the whole
1503
+ `revturbine_server` module (Python).
1504
+ - **Why the breakage is nominal** — every removed method called a hosted decision
1505
+ endpoint that no longer exists, so each had been returning a **network error**
1506
+ since that endpoint was deleted, in two languages, unnoticed — because the
1507
+ cross-port gate only ever asked whether a method of that *name* existed.
1508
+ - **What stays** — `RevTurbineServer` itself, and `createClientSession()`, which
1509
+ mints the browser-safe token the client SDK's `clientSession` callback
1510
+ consumes. An integration using the class only for that is unaffected.
1511
+ - **Replacement** — evaluation is a pure function of (user context, Playbook) and
1512
+ runs in the SDK. Use `LocalEvaluationServer` (Node) or `RevTurbineCustomerSdk`
1513
+ (Python).
1514
+ - **Landed in** — `0.6.0`
1515
+ - **Fail-closed in** — effectively before `0.6.0`: the methods were already
1516
+ erroring. `0.6.0` made the failure a compile/import error instead of a runtime
1517
+ one.
1518
+ - **Proving test** — `tests/no-decision-endpoint.test.ts`
1519
+
1520
+ ---
1521
+
1522
+ ## 0.5.0
1523
+
1524
+ ### The access gate denies during server rendering
1525
+
1526
+ - **What changed** — the gate is constructed inside a `useEffect`, and effects do
1527
+ not run during SSR. So on the server there was no gate at all: `isLoading` read
1528
+ false, `result` was null, `denied` computed false — and the gate emitted its
1529
+ **children**. The server-rendered HTML for a gated feature was literally the
1530
+ paid affordance. It now denies until a real verdict exists.
1531
+ - **Why this one mattered** — it is a fail-open in the one place the client
1532
+ cannot correct it. A crawler or a reader that never runs JS sees the paid
1533
+ content.
1534
+ - **Landed in** — `0.5.0`
1535
+ - **Fail-closed in** — `0.5.0`. This *is* the fail-closed change.
1536
+ - **Proving test** — `web-sdk/placements/AccessGateSurfaceSlot.ssr.test.tsx`
1537
+
1538
+ ---
1539
+
1540
+ ## 0.4.0
1541
+
1542
+ ### An unresolvable plan identity denies in Python and Rust
1543
+
1544
+ - **What changed** — the headless ports granted where TypeScript denied when a
1545
+ user context carried no resolvable plan identity. The ports now deny, matching
1546
+ TypeScript.
1547
+ - **Landed in** — `0.4.0`
1548
+ - **Fail-closed in** — `0.4.0` for Python and Rust; TypeScript already denied.
1549
+ **The window between `0.3.0` and `0.4.0` is the expensive one** — a context
1550
+ that failed closed in TS silently granted in the other two runtimes.
1551
+ - **Proving test** — the cross-language parity corpus, which is what surfaced the
1552
+ divergence: the gate had been green while `deriveLocalEntitlementFromConfiguredRules`
1553
+ sat unreached by any fixture.
1554
+
1555
+ ---
1556
+
1557
+ ## 0.3.0
1558
+
1559
+ This release is where the `plan: { id }` → `plan_handle` migration landed. It was
1560
+ a **minor** bump carrying breaking changes, authorised because there were no
1561
+ active tenants and only in-org code referenced the changed surfaces.
1562
+
1563
+ ### `plan: { id }` → `plan: { handle }` / `plan_handle`
1564
+
1565
+ - **What changed** — a plan's matching identity is its `unique_handle`.
1566
+ `plan.id` is DB-internal and no longer participates in matching anywhere, in
1567
+ any of the three runtimes.
1568
+ - **Symptom if you do not migrate** — a context whose only plan signal is
1569
+ `plan.id` now matches **no** plan-targeted rule and fails closed. It does not
1570
+ error; it simply has no plan.
1571
+ - **Landed in** — `0.3.0`
1572
+ - **Fail-closed in** — `0.3.0`.
1573
+ - **Proving test** — `web-sdk/user-context-exactness.test-d.ts` plus the
1574
+ plan-identity parity fixtures
1575
+ (`tests/parity/fixtures/entitlement_plan_identity_is_handle.json`,
1576
+ `entitlement_no_plan_identity_denies.json`).
1577
+
1578
+ ### `identify()` no longer accepts an arbitrary traits bag
1579
+
1580
+ - **What changed** — unknown top-level context keys are a compile error.
1581
+ Free-form values go under `custom`, via `update()`.
1582
+ - **Landed in** — `0.3.0`
1583
+ - **Fail-closed in** — `0.3.0`, at compile time.
1584
+ - **Proving test** — `web-sdk/user-context-exactness.test-d.ts`
1585
+
1586
+ ### `local_runtime_default_allow` → `entitlement_not_in_playbook`
1587
+
1588
+ - **What changed** — the reason code was renamed with **no deprecated alias**,
1589
+ and the headless runtimes' terminal fallback now **denies** where it used to
1590
+ grant.
1591
+ - **Landed in** — `0.3.0`
1592
+ - **Fail-closed in** — `0.3.0`. The rename and the fail-closed flip shipped
1593
+ together, deliberately: the old name described a grant, so keeping it as an
1594
+ alias would have described the new behaviour incorrectly.
1595
+ - **Proving test** — the fail-closed suites in `web-sdk/` and the corresponding
1596
+ Python and Rust port suites.
1597
+
1598
+ ---
1599
+
1600
+ ## Before 0.3.0
1601
+
1602
+ Versions `0.1.0` through `0.2.91` predate this changelog. Breaking changes in
1603
+ that range are recorded only in commit history and release notes. If you are
1604
+ upgrading from `0.2.x`, read the `0.3.0` section first — it is the release that
1605
+ changed plan identity, and it is the one most likely to affect you.