effect-dynamodb 1.6.0 → 1.7.1

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/dist/Errors.d.ts CHANGED
@@ -274,19 +274,38 @@ declare const CompositeKeyHoleError_base: new <A extends Record<string, any> = {
274
274
  readonly _tag: "CompositeKeyHoleError";
275
275
  } & Readonly<A>;
276
276
  /**
277
- * EDD-9024 — A GSI composite at hierarchy position `i` was cleared (or
278
- * omitted-with-`sparse`) while a composite at position `j > i` was still
279
- * present in the composed payload. Composed keys can't carry holes
280
- * meaningfully — `acc#A#child#Y` with `parent` cleared composes to a
281
- * syntactically invalid prefix that no `begins_with` query would match.
277
+ * EDD-9024 — DEPRECATED in v1.7.1.
282
278
  *
283
- * Raised at write time (Entity.update / time-series .append). The error
284
- * names the GSI, the cleared/omitted composite at position `i`, and the
285
- * still-present trailing composite at position `j` so callers can locate
286
- * the offending payload field.
279
+ * @deprecated Since v1.7.1, this error is no longer thrown at runtime. It is
280
+ * kept as an exported class for back-compat with consumers who type-imported
281
+ * it (e.g. inside `Effect.catchTag("CompositeKeyHoleError", ...)` blocks).
282
+ * No code path constructs or throws this error anymore.
287
283
  *
288
- * See `DESIGN.md §7 Policy-Aware GSI Composition` (hole detection) and
289
- * `§7.6 Hierarchical SK Pruning` (the supported trailing-clear case).
284
+ * **Why deprecated.** v1.7.0's "throw under preserve on hole pattern" was a
285
+ * defensive runtime safety net for a case the type system already catches:
286
+ * required composites can't be omitted under `exactOptionalPropertyTypes`
287
+ * since v1.7.0 reverted the v1.6 NullishOr widening. The only remaining
288
+ * runtime "hole" shape is "optional leading composite absent + present
289
+ * trailing composite," which is a normal write the consumer expressly chose.
290
+ *
291
+ * **What replaces it.** Hole patterns now collapse into the unified per-half
292
+ * can't-compose rule:
293
+ * - `'sparse'` half → REMOVE that half's key (drops the half).
294
+ * - `'preserve'` half + composite of the half is in `Entity.remove([...])`
295
+ * → REMOVE that half's key (cascade override fires).
296
+ * - `'preserve'` half + no composite in `Entity.remove([...])` → noop (the
297
+ * stored key is left untouched; may be stale until the next write that
298
+ * touches the half supplies enough composites to recompose, or an
299
+ * `Entity.remove` cascade fires).
300
+ *
301
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (v1.7.1 unified rule).
302
+ *
303
+ * **Migration.** Remove any `Effect.catchTag("CompositeKeyHoleError", ...)`
304
+ * handlers — the throw site is gone and the catch is dead code. If you were
305
+ * relying on the throw to detect bad payloads, switch to declaring the
306
+ * relevant GSI half as `'sparse'` (the consumer-side semantic that always
307
+ * matches the throw's intent — drop the index entry on can't-compose) or
308
+ * supply the surviving composites via `set` in the same update.
290
309
  */
291
310
  export declare class CompositeKeyHoleError extends CompositeKeyHoleError_base<{
292
311
  readonly entityType: string;
@@ -295,14 +314,18 @@ export declare class CompositeKeyHoleError extends CompositeKeyHoleError_base<{
295
314
  readonly trailingComposite: string;
296
315
  readonly clearedPosition: number;
297
316
  readonly trailingPosition: number;
298
- readonly half: "pk" | "sk";
317
+ /** Which GSI key attribute the hole is in — `"pk"` (gsiNpk) or `"sk"` (gsiNsk). */
318
+ readonly key: "pk" | "sk";
299
319
  /** Human-readable description, prefixed with `EDD-9024`. */
300
320
  readonly message: string;
301
321
  }> {
302
322
  }
303
323
  /**
304
- * Build a {@link CompositeKeyHoleError} with a formatted message. Centralises
305
- * the message format so call sites (KeyComposer, Entity) stay consistent.
324
+ * Build a {@link CompositeKeyHoleError} with a formatted message.
325
+ *
326
+ * @deprecated Since v1.7.1 this builder is unused — no code path raises EDD-9024
327
+ * at runtime. Kept exported only for back-compat with consumers who imported
328
+ * the helper. See {@link CompositeKeyHoleError} for the migration path.
306
329
  */
307
330
  export declare const makeCompositeKeyHoleError: (params: {
308
331
  readonly entityType: string;
@@ -311,7 +334,54 @@ export declare const makeCompositeKeyHoleError: (params: {
311
334
  readonly trailingComposite: string;
312
335
  readonly clearedPosition: number;
313
336
  readonly trailingPosition: number;
314
- readonly half: "pk" | "sk";
337
+ readonly key: "pk" | "sk";
315
338
  }) => CompositeKeyHoleError;
339
+ declare const CompositeNullableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
340
+ readonly _tag: "CompositeNullableError";
341
+ } & Readonly<A>;
342
+ /**
343
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
344
+ * constraint has a Schema whose type union includes `null`. Composites
345
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
346
+ * meaningful slot value — only present-with-value or absent. Allowing
347
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
348
+ * on a composite would let `set({ composite: null })` typecheck, then either
349
+ * blow up at runtime or silently produce a key with the literal string
350
+ * `"null"` as a slot.
351
+ *
352
+ * Raised at `Entity.make()` time. The error names the entity, the
353
+ * surface where the composite is declared (primary key / a GSI / a unique
354
+ * constraint), the offending composite attribute, and the resolved Schema
355
+ * path that contains `null`.
356
+ *
357
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
358
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
359
+ * supported under v3's two-way payload classification — `undefined` is
360
+ * "absent" for GSI composition purposes.
361
+ *
362
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
363
+ */
364
+ export declare class CompositeNullableError extends CompositeNullableError_base<{
365
+ readonly entityType: string;
366
+ /** "primaryKey" | "index:<name>" | "unique:<name>" */
367
+ readonly surface: string;
368
+ readonly compositeAttribute: string;
369
+ /** Resolved schema path that revealed the `null` branch. */
370
+ readonly schemaPath: string;
371
+ /** Human-readable description, prefixed with `EDD-9025`. */
372
+ readonly message: string;
373
+ }> {
374
+ }
375
+ /**
376
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
377
+ * the message format so call sites (Entity.make validation paths) stay
378
+ * consistent.
379
+ */
380
+ export declare const makeCompositeNullableError: (params: {
381
+ readonly entityType: string;
382
+ readonly surface: string;
383
+ readonly compositeAttribute: string;
384
+ readonly schemaPath: string;
385
+ }) => CompositeNullableError;
316
386
  export {};
317
387
  //# sourceMappingURL=Errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;;;;AAE1C,oDAAoD;AACpD,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,kDAAkD;AAClD,qBAAa,eAAgB,SAAQ,qBAAoC;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,oDAAoD;AACpD,qBAAa,qBAAsB,SAAQ,2BAA0C;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,yDAAyD;AACzD,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,wDAAwD;AACxD,qBAAa,qBAAsB,SAAQ,2BAA0C;IACnF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;CAAG;;;;AAEL,iDAAiD;AACjD,qBAAa,YAAa,SAAQ,kBAAiC;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE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AE,MAAM,CAAA;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;AAEL;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,KAAG,sBASA,CAAA"}
package/dist/Errors.js CHANGED
@@ -128,33 +128,91 @@ export class CascadePartialFailure extends Data.TaggedError("CascadePartialFailu
128
128
  export class VersionConflict extends Data.TaggedError("VersionConflict") {
129
129
  }
130
130
  /**
131
- * EDD-9024 — A GSI composite at hierarchy position `i` was cleared (or
132
- * omitted-with-`sparse`) while a composite at position `j > i` was still
133
- * present in the composed payload. Composed keys can't carry holes
134
- * meaningfully — `acc#A#child#Y` with `parent` cleared composes to a
135
- * syntactically invalid prefix that no `begins_with` query would match.
131
+ * EDD-9024 — DEPRECATED in v1.7.1.
136
132
  *
137
- * Raised at write time (Entity.update / time-series .append). The error
138
- * names the GSI, the cleared/omitted composite at position `i`, and the
139
- * still-present trailing composite at position `j` so callers can locate
140
- * the offending payload field.
133
+ * @deprecated Since v1.7.1, this error is no longer thrown at runtime. It is
134
+ * kept as an exported class for back-compat with consumers who type-imported
135
+ * it (e.g. inside `Effect.catchTag("CompositeKeyHoleError", ...)` blocks).
136
+ * No code path constructs or throws this error anymore.
141
137
  *
142
- * See `DESIGN.md §7 Policy-Aware GSI Composition` (hole detection) and
143
- * `§7.6 Hierarchical SK Pruning` (the supported trailing-clear case).
138
+ * **Why deprecated.** v1.7.0's "throw under preserve on hole pattern" was a
139
+ * defensive runtime safety net for a case the type system already catches:
140
+ * required composites can't be omitted under `exactOptionalPropertyTypes`
141
+ * since v1.7.0 reverted the v1.6 NullishOr widening. The only remaining
142
+ * runtime "hole" shape is "optional leading composite absent + present
143
+ * trailing composite," which is a normal write the consumer expressly chose.
144
+ *
145
+ * **What replaces it.** Hole patterns now collapse into the unified per-half
146
+ * can't-compose rule:
147
+ * - `'sparse'` half → REMOVE that half's key (drops the half).
148
+ * - `'preserve'` half + composite of the half is in `Entity.remove([...])`
149
+ * → REMOVE that half's key (cascade override fires).
150
+ * - `'preserve'` half + no composite in `Entity.remove([...])` → noop (the
151
+ * stored key is left untouched; may be stale until the next write that
152
+ * touches the half supplies enough composites to recompose, or an
153
+ * `Entity.remove` cascade fires).
154
+ *
155
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (v1.7.1 unified rule).
156
+ *
157
+ * **Migration.** Remove any `Effect.catchTag("CompositeKeyHoleError", ...)`
158
+ * handlers — the throw site is gone and the catch is dead code. If you were
159
+ * relying on the throw to detect bad payloads, switch to declaring the
160
+ * relevant GSI half as `'sparse'` (the consumer-side semantic that always
161
+ * matches the throw's intent — drop the index entry on can't-compose) or
162
+ * supply the surviving composites via `set` in the same update.
144
163
  */
145
164
  export class CompositeKeyHoleError extends Data.TaggedError("CompositeKeyHoleError") {
146
165
  }
147
166
  /**
148
- * Build a {@link CompositeKeyHoleError} with a formatted message. Centralises
149
- * the message format so call sites (KeyComposer, Entity) stay consistent.
167
+ * Build a {@link CompositeKeyHoleError} with a formatted message.
168
+ *
169
+ * @deprecated Since v1.7.1 this builder is unused — no code path raises EDD-9024
170
+ * at runtime. Kept exported only for back-compat with consumers who imported
171
+ * the helper. See {@link CompositeKeyHoleError} for the migration path.
150
172
  */
151
173
  export const makeCompositeKeyHoleError = (params) => new CompositeKeyHoleError({
152
174
  ...params,
153
- message: `[EDD-9024] Composite key hole on GSI "${params.indexName}" of entity "${params.entityType}": ` +
154
- `composite "${params.clearedComposite}" at ${params.half} position ${params.clearedPosition} was cleared ` +
155
- `(or omitted under sparse policy), but composite "${params.trailingComposite}" at ${params.half} position ${params.trailingPosition} is still present. ` +
156
- `Composed keys cannot carry holes — either supply a value for "${params.clearedComposite}", ` +
157
- `clear all trailing composites (>= position ${params.trailingPosition}) too, ` +
158
- `or use Entity.remove(["${params.clearedComposite}"]) to drop the whole GSI.`,
175
+ message: `[EDD-9024 — DEPRECATED] Composite key hole on GSI "${params.indexName}" of entity "${params.entityType}": ` +
176
+ `composite "${params.clearedComposite}" at ${params.key} position ${params.clearedPosition} is absent, ` +
177
+ `but composite "${params.trailingComposite}" at ${params.key} position ${params.trailingPosition} is still present. ` +
178
+ `Since v1.7.1 this error is no longer thrown — hole patterns collapse into the unified per-half can't-compose rule ` +
179
+ `(REMOVE the half under 'sparse' or removedSet cascade; noop under 'preserve' without removedSet).`,
180
+ });
181
+ /**
182
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
183
+ * constraint has a Schema whose type union includes `null`. Composites
184
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
185
+ * meaningful slot value — only present-with-value or absent. Allowing
186
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
187
+ * on a composite would let `set({ composite: null })` typecheck, then either
188
+ * blow up at runtime or silently produce a key with the literal string
189
+ * `"null"` as a slot.
190
+ *
191
+ * Raised at `Entity.make()` time. The error names the entity, the
192
+ * surface where the composite is declared (primary key / a GSI / a unique
193
+ * constraint), the offending composite attribute, and the resolved Schema
194
+ * path that contains `null`.
195
+ *
196
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
197
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
198
+ * supported under v3's two-way payload classification — `undefined` is
199
+ * "absent" for GSI composition purposes.
200
+ *
201
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
202
+ */
203
+ export class CompositeNullableError extends Data.TaggedError("CompositeNullableError") {
204
+ }
205
+ /**
206
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
207
+ * the message format so call sites (Entity.make validation paths) stay
208
+ * consistent.
209
+ */
210
+ export const makeCompositeNullableError = (params) => new CompositeNullableError({
211
+ ...params,
212
+ message: `[EDD-9025] Entity "${params.entityType}": composite attribute "${params.compositeAttribute}" ` +
213
+ `on ${params.surface} resolves to a Schema that includes \`null\` (${params.schemaPath}). ` +
214
+ `Composites participate in string composition and cannot be null — only present-with-value or absent. ` +
215
+ `Replace the nullable wrapper with \`Schema.optional(...)\` (T | undefined) to express the sparse ` +
216
+ `pattern, or supply a non-nullable schema for "${params.compositeAttribute}".`,
159
217
  });
160
218
  //# sourceMappingURL=Errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAA;AAE1C,oDAAoD;AACpD,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAG7D;CAAG;AAEL,kDAAkD;AAClD,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAGrE;CAAG;AAEL,oDAAoD;AACpD,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAGjF;CAAG;AAEL,yDAAyD;AACzD,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAG7E;CAAG;AAEL,wDAAwD;AACxD,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAGjF;CAAG;AAEL,iDAAiD;AACjD,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,WAAW,CAAC,cAAc,CAG/D;CAAG;AAEL;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,sBAAuB,SAAQ,IAAI,C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AC;IACzB,GAAG,MAAM;IACT,OAAO,EACL,sBAAsB,MAAM,CAAC,UAAU,2BAA2B,MAAM,CAAC,kBAAkB,IAAI;QAC/F,MAAM,MAAM,CAAC,OAAO,iDAAiD,MAAM,CAAC,UAAU,KAAK;QAC3F,uGAAuG;QACvG,mGAAmG;QACnG,iDAAiD,MAAM,CAAC,kBAAkB,IAAI;CACjF,CAAC,CAAA"}
@@ -6,31 +6,54 @@
6
6
  * the key format; KeyComposer extracts attribute values and delegates.
7
7
  */
8
8
  import type * as DynamoSchema from "./DynamoSchema.js";
9
- import { type CompositeKeyHoleError } from "./Errors.js";
9
+ import type { CompositeKeyHoleError } from "./Errors.js";
10
10
  /** Index key part definition (pk or sk of an index) */
11
11
  export interface KeyPart {
12
12
  readonly field: string;
13
13
  readonly composite: ReadonlyArray<string>;
14
14
  }
15
15
  /**
16
- * Per-composite policy value controlling how `Entity.update` and time-series
17
- * `.append` handle a composite attribute that is absent from the merged update
18
- * payload.
19
- *
20
- * - `"sparse"` — absent → REMOVE `gsiNpk`/`gsiNsk`; item drops out of the GSI.
21
- * - `"preserve"` — absent → leave the stored GSI key field untouched.
22
- *
23
- * Attributes not covered by an `indexPolicy` default to `"preserve"`. See
24
- * `DESIGN.md §7 Policy-Aware GSI Composition` for full decision rules.
25
- */
26
- export type IndexPolicyAttr = "sparse" | "preserve";
27
- /**
28
- * Function form of an index policy. Receives the merged record
29
- * (`primaryKey + payload` at update time, `primaryKey + appendInput` at append
30
- * time) and returns a per-attribute policy map. Only keys corresponding to
31
- * composite attributes of this GSI are consulted; additional keys are ignored.
32
- */
33
- export type IndexPolicy = (item: Readonly<Record<string, unknown>>) => Partial<Record<string, IndexPolicyAttr>>;
16
+ * Per-half policy value controlling how `Entity.update` and time-series
17
+ * `.append` handle a GSI half the writer touches but can't compose.
18
+ *
19
+ * Per-half evaluation gate (v1.7.1): a half is *touched* iff at least one of
20
+ * its composite names appears in the update payload (regardless of value,
21
+ * including `undefined`) OR appears in `Entity.remove([...])`. Untouched
22
+ * halves are skipped entirely — no SET, no REMOVE, no policy fires.
23
+ *
24
+ * For *touched* halves the policy decides the outcome when the structural
25
+ * rule can't compose (empty leading prefix OR hole pattern):
26
+ * - `"sparse"` — REMOVE this half's key attribute (the half drops out of the
27
+ * GSI). The other half follows its own per-half outcome independently —
28
+ * there is no GSI-wide cascade. The DDB projection rule means an item with
29
+ * only one key attribute is invisible in the GSI; the surviving half's
30
+ * value is preserved for rejoin without other writers re-firing.
31
+ * - `"preserve"` — noop (leave the stored key for this half untouched). The
32
+ * stored value may go stale until either (a) the next write that touches
33
+ * this half supplies enough composites to recompose, or (b) a composite of
34
+ * this half is named in `Entity.remove([...])` — the cascade override
35
+ * then REMOVEs this half's key.
36
+ *
37
+ * Halves not declared in `indexPolicy` default to `"preserve"`. See
38
+ * `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision rules
39
+ * (per-half evaluation gate, per-half outcome, cascade override, decision
40
+ * table).
41
+ */
42
+ export type IndexPolicyKey = "sparse" | "preserve";
43
+ /**
44
+ * Per-half index policy declaration. Both halves default to `"preserve"`
45
+ * when omitted (or when `indexPolicy` is omitted entirely from the GSI
46
+ * config).
47
+ *
48
+ * The standard composition path has only payload-level information (no
49
+ * read-before-write), so per-attribute policy callbacks were removed in
50
+ * v3 — within a single half, per-attribute mixing has no coherent semantic
51
+ * because a half is a single concatenated string.
52
+ */
53
+ export interface IndexPolicy {
54
+ readonly pk?: IndexPolicyKey | undefined;
55
+ readonly sk?: IndexPolicyKey | undefined;
56
+ }
34
57
  /** Index definition for primary or secondary index (internal format) */
35
58
  export interface IndexDefinition {
36
59
  readonly index?: string | undefined;
@@ -40,9 +63,9 @@ export interface IndexDefinition {
40
63
  readonly sk: KeyPart;
41
64
  readonly casing?: DynamoSchema.Casing | undefined;
42
65
  /**
43
- * Optional per-composite policy for `Entity.update` and `.append`. Not
44
- * consulted on `put()` — put always omits a GSI's keys when any of its
45
- * composites is missing.
66
+ * Optional per-half policy for `Entity.update` and `.append`. Not consulted
67
+ * on `put()` — put always omits a GSI's keys when any of its composites is
68
+ * missing.
46
69
  */
47
70
  readonly indexPolicy?: IndexPolicy | undefined;
48
71
  }
@@ -60,13 +83,9 @@ export interface GsiConfig {
60
83
  /** Sort key: physical field name + composite attributes. */
61
84
  readonly sk: KeyPart;
62
85
  /**
63
- * Per-composite sparse/preserve policy. Applied by `Entity.update` and
64
- * time-series `.append`. Defaults to `"preserve"` for any composite the
65
- * function does not specify. Not applied on `put()`.
66
- *
67
- * At append-time, returned keys must be members of the `appendInput`
68
- * schema (enforced at `Entity.make()`) — composites owned by other writers
69
- * cannot have policy at append-time, since `.append` cannot touch them.
86
+ * Per-half sparse/preserve policy. Applied by `Entity.update` and
87
+ * time-series `.append`. Defaults to `"preserve"` on each half. Not
88
+ * applied on `put()`. See `DESIGN.md §7 Policy-Aware GSI Composition`.
70
89
  */
71
90
  readonly indexPolicy?: IndexPolicy | undefined;
72
91
  }
@@ -143,72 +162,68 @@ export interface GsiUpdateResult {
143
162
  }
144
163
  /**
145
164
  * Compose a sort key from the leading prefix `[sk_0, ..., sk_(stopBefore-1)]`
146
- * of an index's SK composites. Used by hierarchical SK pruning when a
147
- * trailing SK composite is explicitly cleared with `preserve` policy — the
148
- * resulting `gsiNsk` keeps the parent context and the item stays queryable
149
- * at the coarser depth.
165
+ * of an index's SK composites. Used by v3's structural composition rule when a
166
+ * trailing SK composite is absent and the half's `indexPolicy.sk` is
167
+ * `"preserve"` (or absent — defaults to preserve), or when a hole pattern is
168
+ * encountered under `"sparse"`.
150
169
  *
151
170
  * `stopBefore === 0` produces the bare entity/collection prefix with no
152
171
  * composite values (the item still belongs to the GSI but at the broadest
153
172
  * scope — `begins_with(sk, "<prefix>")` matches it).
154
173
  *
155
- * See `DESIGN.md §7.6 Hierarchical SK Pruning`.
174
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
156
175
  */
157
176
  export declare const composeSkPrefixUpTo: (schema: DynamoSchema.DynamoSchema, entityType: string, entityVersion: number, index: IndexDefinition, record: Record<string, unknown>, stopBefore: number) => string;
158
177
  /**
159
178
  * Policy-aware GSI key composition for `Entity.update` and time-series
160
- * `.append`.
161
- *
162
- * Implements the v2 unified-hierarchy three-way payload classification:
179
+ * `.append` — v1.7.1 per-half structural composition with per-half evaluation
180
+ * gate and per-half cascade.
181
+ *
182
+ * **Per-half evaluation gate (v1.7.1).** Each half (PK and SK) is independently
183
+ * checked for whether the writer touched it. A half is "touched" iff at least
184
+ * one of its composite names appears in `updatePayload` (regardless of value,
185
+ * including `undefined`) OR appears in `removedSet`. **Untouched halves are
186
+ * skipped entirely — no SET, no REMOVE, no policy fires.** This closes the
187
+ * v1.7.0 multi-writer leak where a "stamp" writer that doesn't touch a GSI's
188
+ * composites would still trigger the policy and blow away another writer's
189
+ * key.
190
+ *
191
+ * **Two-way payload classification.**
163
192
  * - **present** (`attr: <value>` in payload, or inherited from `keyRecord`)
164
193
  * — value is used in composition.
165
- * - **explicit clear** (`attr: null` or `attr: undefined` in payload) —
166
- * `null` and `undefined` collapse and cascade unconditionally; policy is
167
- * bypassed for explicit clears.
168
- * - **omitted** (key not in payload at all) — `indexPolicy` is consulted.
169
- * Default policy is `"preserve"` for any composite not declared.
170
- *
171
- * Per-attribute outcomes (per touched GSI):
172
- *
173
- * | State | PK composite | SK composite |
174
- * | ------------- | ------------------------- | -------------------------------------------- |
175
- * | omitted+sparse| Drop the GSI | Drop the GSI |
176
- * | omitted+preserve | No-op for that half | No-op for that half |
177
- * | clear+sparse | Drop the GSI | Drop the GSI |
178
- * | clear+preserve| Drop the GSI (degrades to sparse on PK — partition migration is almost always wrong) | **Truncate `gsiNsk`** at this composite (hierarchical pruning) |
179
- *
180
- * Cascade (`Entity.remove([attr])`) overrides everything: any composite in
181
- * `removedSet` forces a full GSI drop.
182
- *
183
- * **Hole detection.** Throws `CompositeKeyHoleError` (EDD-9024) when an SK
184
- * composite at position `i` is cleared (with preserve) while a composite at
185
- * position `j > i` is still present in the merged payload — composed keys
186
- * cannot carry holes.
187
- *
188
- * A GSI is considered "touched" when any of its composites appears in
189
- * `updatePayload` (present, explicit clear, or omitted-with-`indexPolicy`),
190
- * or `removedSet`. GSIs without an `indexPolicy` are skipped when none of
191
- * their composites are touched. GSIs with a policy are always evaluated —
192
- * the policy is a declarative statement about the GSI's membership.
194
+ * - **absent** (key omitted, or `attr: null`, or `attr: undefined`) — the
195
+ * structural rule treats all three identically.
196
+ *
197
+ * **Per-half outcome (v1.7.1 unified rule).** For each touched half:
198
+ * 1. Run the structural rule (longest leading prefix of present values in
199
+ * the merged record).
200
+ * 2. If the prefix is non-empty AND there's no hole → SET (full or truncated).
201
+ * 3. Otherwise (empty leading prefix OR hole pattern):
202
+ * - `'sparse'` → REMOVE this half's key.
203
+ * - `'preserve'` AND any composite of this half is in `removedSet` →
204
+ * REMOVE (cascade override under preserve).
205
+ * - `'preserve'` AND no composite in `removedSet` → noop (stored key
206
+ * retained, may be stale until next write touches the half).
207
+ *
208
+ * **Per-half roll-up (v1.7.1).** Each half's outcome applies to its own key
209
+ * attribute only. PK dropping doesn't drop SK; SK dropping doesn't drop PK.
210
+ * The item may be invisible in the GSI during a single-half-dropped period
211
+ * (DDB projection rule needs both keys for query visibility), but the
212
+ * surviving half's value persists for rejoin without other writers re-firing.
213
+ * The v1.7.0 GSI-wide cascade is gone.
214
+ *
215
+ * **`Entity.remove([attr])` cascade (v1.7.1: per-half).** Composites in
216
+ * `removedSet` contribute to the merged record as "absent" (same as
217
+ * undefined-in-payload) AND make their containing half "touched" for the
218
+ * evaluation gate AND trigger the cascade override under preserve. The
219
+ * cascade no longer drops both halves of every GSI containing the cleared
220
+ * attribute — only the half(s) whose composite list contains it.
193
221
  *
194
222
  * See `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision
195
- * algorithm and worked decision table, and `§7.6 Hierarchical SK Pruning`
196
- * for the trailing-clear truncation contract.
197
- *
198
- * @throws {CompositeKeyHoleError} EDD-9024 on hole-pattern detection.
223
+ * table and worked multi-writer examples.
199
224
  */
200
225
  export declare const composeGsiKeysForUpdatePolicyAware: (schema: DynamoSchema.DynamoSchema, entityType: string, entityVersion: number, indexes: Record<string, IndexDefinition>, updatePayload: Record<string, unknown>, keyRecord: Record<string, unknown>, options?: {
201
226
  readonly removedSet?: ReadonlySet<string> | undefined;
202
- /**
203
- * Attributes that appear in `updatePayload` with value `null` or
204
- * `undefined` — i.e. the consumer explicitly cleared them. The library
205
- * distinguishes this from omission to give consumers an unambiguous
206
- * "drop this composite from the key" instruction; `null` and
207
- * `undefined` collapse here to eliminate the long-standing footgun of
208
- * dev confusion between the two in TypeScript with
209
- * `exactOptionalPropertyTypes`.
210
- */
211
- readonly clearedSet?: ReadonlySet<string> | undefined;
212
227
  }) => GsiUpdateResult;
213
228
  /** @internal — re-export for documentation cross-reference. */
214
229
  export type { CompositeKeyHoleError };
@@ -1 +1 @@
1
- {"version":3,"file":"KeyComposer.d.ts","sourceRoot":"","sources":["../src/KeyComposer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAQtD,OAAO,EAAE,KAAK,qBAAqB,EAA6B,MAAM,aAAa,CAAA;AAEnF,uDAAuD;AACvD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CAC1C;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;AAE7C,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK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