effect-dynamodb 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Errors.d.ts CHANGED
@@ -274,19 +274,27 @@ 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 — A GSI composite at half-position `i` was absent while a composite
278
+ * at position `j > i` was still present, AND the half's `indexPolicy` is
279
+ * `'preserve'`. Composed keys can't carry holes meaningfully — `acc#A#child#Y`
280
+ * with `parent` cleared composes to a syntactically invalid prefix that no
281
+ * `begins_with` query would match. Under `'preserve'`, the library refuses to
282
+ * silently drop the trailing composite and raises this error instead. Under
283
+ * `'sparse'`, the trailing composite is silently truncated to the leading
284
+ * prefix and no error is raised (and when the leading prefix is empty,
285
+ * the half collapses to whole-half-empty which sparse drops together with
286
+ * the other half).
282
287
  *
283
288
  * 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.
289
+ * names the GSI, the absent composite at position `i`, and the still-present
290
+ * trailing composite at position `j` so callers can locate the offending
291
+ * payload field.
287
292
  *
288
- * See `DESIGN.md §7 Policy-Aware GSI Composition` (hole detection) and
289
- * `§7.6 Hierarchical SK Pruning` (the supported trailing-clear case).
293
+ * Resolutions: supply a value for the absent composite, clear (omit or
294
+ * `Entity.remove(...)`) all trailing composites too, or set
295
+ * `indexPolicy.<key>` to `'sparse'` to opt into truncate-on-hole semantics.
296
+ *
297
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
290
298
  */
291
299
  export declare class CompositeKeyHoleError extends CompositeKeyHoleError_base<{
292
300
  readonly entityType: string;
@@ -295,7 +303,8 @@ export declare class CompositeKeyHoleError extends CompositeKeyHoleError_base<{
295
303
  readonly trailingComposite: string;
296
304
  readonly clearedPosition: number;
297
305
  readonly trailingPosition: number;
298
- readonly half: "pk" | "sk";
306
+ /** Which GSI key attribute the hole is in — `"pk"` (gsiNpk) or `"sk"` (gsiNsk). */
307
+ readonly key: "pk" | "sk";
299
308
  /** Human-readable description, prefixed with `EDD-9024`. */
300
309
  readonly message: string;
301
310
  }> {
@@ -311,7 +320,54 @@ export declare const makeCompositeKeyHoleError: (params: {
311
320
  readonly trailingComposite: string;
312
321
  readonly clearedPosition: number;
313
322
  readonly trailingPosition: number;
314
- readonly half: "pk" | "sk";
323
+ readonly key: "pk" | "sk";
315
324
  }) => CompositeKeyHoleError;
325
+ 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 & {
326
+ readonly _tag: "CompositeNullableError";
327
+ } & Readonly<A>;
328
+ /**
329
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
330
+ * constraint has a Schema whose type union includes `null`. Composites
331
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
332
+ * meaningful slot value — only present-with-value or absent. Allowing
333
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
334
+ * on a composite would let `set({ composite: null })` typecheck, then either
335
+ * blow up at runtime or silently produce a key with the literal string
336
+ * `"null"` as a slot.
337
+ *
338
+ * Raised at `Entity.make()` time. The error names the entity, the
339
+ * surface where the composite is declared (primary key / a GSI / a unique
340
+ * constraint), the offending composite attribute, and the resolved Schema
341
+ * path that contains `null`.
342
+ *
343
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
344
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
345
+ * supported under v3's two-way payload classification — `undefined` is
346
+ * "absent" for GSI composition purposes.
347
+ *
348
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
349
+ */
350
+ export declare class CompositeNullableError extends CompositeNullableError_base<{
351
+ readonly entityType: string;
352
+ /** "primaryKey" | "index:<name>" | "unique:<name>" */
353
+ readonly surface: string;
354
+ readonly compositeAttribute: string;
355
+ /** Resolved schema path that revealed the `null` branch. */
356
+ readonly schemaPath: string;
357
+ /** Human-readable description, prefixed with `EDD-9025`. */
358
+ readonly message: string;
359
+ }> {
360
+ }
361
+ /**
362
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
363
+ * the message format so call sites (Entity.make validation paths) stay
364
+ * consistent.
365
+ */
366
+ export declare const makeCompositeNullableError: (params: {
367
+ readonly entityType: string;
368
+ readonly surface: string;
369
+ readonly compositeAttribute: string;
370
+ readonly schemaPath: string;
371
+ }) => CompositeNullableError;
316
372
  export {};
317
373
  //# 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,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AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;CAC1B,KAAG,qBAYA,CAAA;;;;AAEJ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,sBAAuB,SAAQ,4BAA2C;IACrF,QAAQ,CAAC,UAAU,EAAE,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,19 +128,27 @@ 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 — A GSI composite at half-position `i` was absent while a composite
132
+ * at position `j > i` was still present, AND the half's `indexPolicy` is
133
+ * `'preserve'`. Composed keys can't carry holes meaningfully — `acc#A#child#Y`
134
+ * with `parent` cleared composes to a syntactically invalid prefix that no
135
+ * `begins_with` query would match. Under `'preserve'`, the library refuses to
136
+ * silently drop the trailing composite and raises this error instead. Under
137
+ * `'sparse'`, the trailing composite is silently truncated to the leading
138
+ * prefix and no error is raised (and when the leading prefix is empty,
139
+ * the half collapses to whole-half-empty which sparse drops together with
140
+ * the other half).
136
141
  *
137
142
  * 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.
143
+ * names the GSI, the absent composite at position `i`, and the still-present
144
+ * trailing composite at position `j` so callers can locate the offending
145
+ * payload field.
141
146
  *
142
- * See `DESIGN.md §7 Policy-Aware GSI Composition` (hole detection) and
143
- * `§7.6 Hierarchical SK Pruning` (the supported trailing-clear case).
147
+ * Resolutions: supply a value for the absent composite, clear (omit or
148
+ * `Entity.remove(...)`) all trailing composites too, or set
149
+ * `indexPolicy.<key>` to `'sparse'` to opt into truncate-on-hole semantics.
150
+ *
151
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
144
152
  */
145
153
  export class CompositeKeyHoleError extends Data.TaggedError("CompositeKeyHoleError") {
146
154
  }
@@ -151,10 +159,49 @@ export class CompositeKeyHoleError extends Data.TaggedError("CompositeKeyHoleErr
151
159
  export const makeCompositeKeyHoleError = (params) => new CompositeKeyHoleError({
152
160
  ...params,
153
161
  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. ` +
162
+ `composite "${params.clearedComposite}" at ${params.key} position ${params.clearedPosition} is absent, ` +
163
+ `but composite "${params.trailingComposite}" at ${params.key} position ${params.trailingPosition} is still present, ` +
164
+ `and indexPolicy.${params.key} is 'preserve'. ` +
156
165
  `Composed keys cannot carry holes — either supply a value for "${params.clearedComposite}", ` +
157
166
  `clear all trailing composites (>= position ${params.trailingPosition}) too, ` +
167
+ `set indexPolicy.${params.key} = 'sparse' to opt into truncate-on-hole, ` +
158
168
  `or use Entity.remove(["${params.clearedComposite}"]) to drop the whole GSI.`,
159
169
  });
170
+ /**
171
+ * EDD-9025 — A composite attribute on `primaryKey`, `indexes`, or a `unique`
172
+ * constraint has a Schema whose type union includes `null`. Composites
173
+ * participate in string composition (`acc#X#alert#Y`); `null` is not a
174
+ * meaningful slot value — only present-with-value or absent. Allowing
175
+ * `Schema.NullOr` / `Schema.NullishOr` / `Schema.Union([..., Schema.Null])`
176
+ * on a composite would let `set({ composite: null })` typecheck, then either
177
+ * blow up at runtime or silently produce a key with the literal string
178
+ * `"null"` as a slot.
179
+ *
180
+ * Raised at `Entity.make()` time. The error names the entity, the
181
+ * surface where the composite is declared (primary key / a GSI / a unique
182
+ * constraint), the offending composite attribute, and the resolved Schema
183
+ * path that contains `null`.
184
+ *
185
+ * Resolution: declare the attribute as `Schema.optional(...)` (which
186
+ * produces `T | undefined` without `null`). Sparse-pattern usage is fully
187
+ * supported under v3's two-way payload classification — `undefined` is
188
+ * "absent" for GSI composition purposes.
189
+ *
190
+ * See `DESIGN.md §7 Policy-Aware GSI Composition` (EDD-9025 footgun gate).
191
+ */
192
+ export class CompositeNullableError extends Data.TaggedError("CompositeNullableError") {
193
+ }
194
+ /**
195
+ * Build a {@link CompositeNullableError} with a formatted message. Centralises
196
+ * the message format so call sites (Entity.make validation paths) stay
197
+ * consistent.
198
+ */
199
+ export const makeCompositeNullableError = (params) => new CompositeNullableError({
200
+ ...params,
201
+ message: `[EDD-9025] Entity "${params.entityType}": composite attribute "${params.compositeAttribute}" ` +
202
+ `on ${params.surface} resolves to a Schema that includes \`null\` (${params.schemaPath}). ` +
203
+ `Composites participate in string composition and cannot be null — only present-with-value or absent. ` +
204
+ `Replace the nullable wrapper with \`Schema.optional(...)\` (T | undefined) to express the sparse ` +
205
+ `pattern, or supply a non-nullable schema for "${params.compositeAttribute}".`,
206
+ });
160
207
  //# 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,CAAC,WAAW,CAAC,wBAAwB,CAInF;CAAG;AAEL;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAK7D;CAAG;AAEL,6CAA6C;AAC7C,MAAM,OAAO,eAAgB,SAA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AAO,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"}
@@ -13,24 +13,37 @@ export interface KeyPart {
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 whose composites are absent from the merged
18
+ * update payload.
19
+ *
20
+ * - `"sparse"` — when the half's composites are entirely absent (whole-half
21
+ * empty), REMOVE both `gsiNpk` and `gsiNsk` (item drops out of the GSI).
22
+ * On a hole pattern (`[A, _, C]`), truncate the half to the leading prefix
23
+ * `[A]` and ignore trailing values.
24
+ * - `"preserve"` — whole-half-empty is a no-op; the stored values for that
25
+ * half stay intact. On a hole pattern, throw `CompositeKeyHoleError`
26
+ * (EDD-9024) at write time.
27
+ *
28
+ * Halves not declared in `indexPolicy` default to `"preserve"`. See
29
+ * `DESIGN.md §7 Policy-Aware GSI Composition` for the full decision rules
30
+ * (structural composition, two drop triggers, decision table).
31
+ */
32
+ export type IndexPolicyKey = "sparse" | "preserve";
33
+ /**
34
+ * Per-half index policy declaration. Both halves default to `"preserve"`
35
+ * when omitted (or when `indexPolicy` is omitted entirely from the GSI
36
+ * config).
37
+ *
38
+ * The standard composition path has only payload-level information (no
39
+ * read-before-write), so per-attribute policy callbacks were removed in
40
+ * v3 — within a single half, per-attribute mixing has no coherent semantic
41
+ * because a half is a single concatenated string.
42
+ */
43
+ export interface IndexPolicy {
44
+ readonly pk?: IndexPolicyKey | undefined;
45
+ readonly sk?: IndexPolicyKey | undefined;
46
+ }
34
47
  /** Index definition for primary or secondary index (internal format) */
35
48
  export interface IndexDefinition {
36
49
  readonly index?: string | undefined;
@@ -40,9 +53,9 @@ export interface IndexDefinition {
40
53
  readonly sk: KeyPart;
41
54
  readonly casing?: DynamoSchema.Casing | undefined;
42
55
  /**
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.
56
+ * Optional per-half policy for `Entity.update` and `.append`. Not consulted
57
+ * on `put()` — put always omits a GSI's keys when any of its composites is
58
+ * missing.
46
59
  */
47
60
  readonly indexPolicy?: IndexPolicy | undefined;
48
61
  }
@@ -60,13 +73,9 @@ export interface GsiConfig {
60
73
  /** Sort key: physical field name + composite attributes. */
61
74
  readonly sk: KeyPart;
62
75
  /**
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.
76
+ * Per-half sparse/preserve policy. Applied by `Entity.update` and
77
+ * time-series `.append`. Defaults to `"preserve"` on each half. Not
78
+ * applied on `put()`. See `DESIGN.md §7 Policy-Aware GSI Composition`.
70
79
  */
71
80
  readonly indexPolicy?: IndexPolicy | undefined;
72
81
  }
@@ -143,72 +152,51 @@ export interface GsiUpdateResult {
143
152
  }
144
153
  /**
145
154
  * 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.
155
+ * of an index's SK composites. Used by v3's structural composition rule when a
156
+ * trailing SK composite is absent and the half's `indexPolicy.sk` is
157
+ * `"preserve"` (or absent — defaults to preserve), or when a hole pattern is
158
+ * encountered under `"sparse"`.
150
159
  *
151
160
  * `stopBefore === 0` produces the bare entity/collection prefix with no
152
161
  * composite values (the item still belongs to the GSI but at the broadest
153
162
  * scope — `begins_with(sk, "<prefix>")` matches it).
154
163
  *
155
- * See `DESIGN.md §7.6 Hierarchical SK Pruning`.
164
+ * See `DESIGN.md §7 Policy-Aware GSI Composition`.
156
165
  */
157
166
  export declare const composeSkPrefixUpTo: (schema: DynamoSchema.DynamoSchema, entityType: string, entityVersion: number, index: IndexDefinition, record: Record<string, unknown>, stopBefore: number) => string;
158
167
  /**
159
168
  * Policy-aware GSI key composition for `Entity.update` and time-series
160
- * `.append`.
169
+ * `.append` — v3 per-half structural composition.
161
170
  *
162
- * Implements the v2 unified-hierarchy three-way payload classification:
171
+ * Implements two-way payload classification:
163
172
  * - **present** (`attr: <value>` in payload, or inherited from `keyRecord`)
164
173
  * — 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):
174
+ * - **absent** (key omitted, or `attr: null`, or `attr: undefined`) — the
175
+ * structural rule treats all three identically.
172
176
  *
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) |
177
+ * For each touched GSI half (PK and SK independently), walk the composite
178
+ * list left-to-right and build the longest valid leading prefix. Policy is
179
+ * consulted only for the hole pattern (truncate under sparse, throw EDD-9024
180
+ * under preserve) and the whole-half-empty case (drop both keys under
181
+ * sparse, no-op under preserve).
179
182
  *
180
183
  * 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.
184
+ * `removedSet` forces a full GSI drop (REMOVE both `gsiNpk` and `gsiNsk`).
187
185
  *
188
186
  * 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.
187
+ * `updatePayload`, or `removedSet`. GSIs without an `indexPolicy` are skipped
188
+ * when none of their composites are touched. GSIs with a policy are always
189
+ * evaluated — the policy is a declarative statement about the GSI's
190
+ * membership invariant.
193
191
  *
194
192
  * 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.
193
+ * algorithm, decision table, and the two-drop-trigger framing.
197
194
  *
198
- * @throws {CompositeKeyHoleError} EDD-9024 on hole-pattern detection.
195
+ * @throws {CompositeKeyHoleError} EDD-9024 on hole-pattern detection under
196
+ * `'preserve'` policy.
199
197
  */
200
198
  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
199
  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
200
  }) => GsiUpdateResult;
213
201
  /** @internal — re-export for documentation cross-reference. */
214
202
  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,eA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