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