graphddb 0.7.7 → 0.7.9

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.
@@ -437,14 +437,14 @@ declare const RAW_COND: unique symbol;
437
437
  * `FilterInput<M>` of the same model, so embedding a different model's column
438
438
  * is a compile error.
439
439
  */
440
- interface RawCondition<M = unknown> {
440
+ interface RawCondition<M = unknown, P extends readonly unknown[] = readonly unknown[]> {
441
441
  readonly [RAW_COND]: true;
442
442
  /** @internal phantom — owning-model brand. */
443
443
  readonly __model?: M;
444
444
  /** Expression fragment with `{name}` / `{value}` markers already inlined. */
445
445
  readonly template: TemplateStringsArray;
446
446
  /** The interpolated parts, each either a Column ref or an embedded value. */
447
- readonly parts: unknown[];
447
+ readonly parts: P;
448
448
  }
449
449
  /**
450
450
  * The interpolation slot type accepted by {@link cond}. A column reference
@@ -469,7 +469,7 @@ type CondSlot<M> = Column<any, M> | string | number | boolean | Date | Param<unk
469
469
  * filter: cond`${User.col.age} > ${18} and attribute_exists(${User.col.email})`
470
470
  * ```
471
471
  */
472
- declare function cond<M = unknown>(template: TemplateStringsArray, ...parts: CondSlot<M>[]): RawCondition<M>;
472
+ declare function cond<M = unknown, const P extends readonly CondSlot<M>[] = readonly CondSlot<M>[]>(template: TemplateStringsArray, ...parts: P): RawCondition<M, P>;
473
473
 
474
474
  /**
475
475
  * Type-safe attribute condition API (DynamoDB `FilterExpression`).
@@ -1385,10 +1385,12 @@ interface CtxBase {
1385
1385
  /**
1386
1386
  * The logical read kinds an {@link ReadRequestCtx} may carry (R1 / R4 / R5).
1387
1387
  *
1388
- * Only the kinds the runtime actually emits are advertised. A `query` route in
1389
- * the read envelope delegates to {@link import('../operations/query.js').executeQuery}
1390
- * (kind `'query'`), a `list` route to {@link import('../operations/list.js').executeList}
1391
- * (kind `'list'`), so there is no distinct `'envelopeRoute'` kind. `batchGet`
1388
+ * Only the kinds the runtime actually emits are advertised. Every read surface
1389
+ * (the ad-hoc `Model.query` / `Model.list`, a read-envelope route, a prepared
1390
+ * read) lowers to the unified internal read plan and executes through
1391
+ * {@link import('../runtime/read-plan.js').executeCompiledReadRoute} (issue
1392
+ * #249), which runs the single-item core (kind `'query'`) or the partition core
1393
+ * (kind `'list'`) — so there is no distinct `'envelopeRoute'` kind. `batchGet`
1392
1394
  * (`DDBModel.batchGet`, the public multi-key read primitive) fires request-level
1393
1395
  * hooks since issue #142 — its R1/R4/R5 carry kind `'batchGet'`; each underlying
1394
1396
  * physical `BatchGetItem` op fires R2/R3/R5 with op kind `'BatchGetItem'`.
@@ -1910,36 +1912,53 @@ type OperationKind = 'query' | 'list' | 'put' | 'update' | 'delete';
1910
1912
  * / `not` (single nested condition) keys express logical groups. Each operand
1911
1913
  * value may be a concrete literal or a {@link Param} placeholder.
1912
1914
  */
1913
- type ConditionLeaf = Param<unknown> | string | number | boolean | Date;
1915
+ /**
1916
+ * An operand leaf of a declarative condition.
1917
+ *
1918
+ * The optional type parameter `X` names an **extra** operand kind admitted only
1919
+ * in a specific authoring context; it defaults to `never`, so the bare
1920
+ * `ConditionLeaf` (the single-write / contract path) is exactly the original
1921
+ * `Param<unknown> | string | number | boolean | Date` and is unaffected.
1922
+ *
1923
+ * The transaction path (issue #246) passes `X = TransactionRef`: inside
1924
+ * `defineTransaction` a condition operand may be a `p.*` field reference (a
1925
+ * {@link import('./transaction.js').TransactionRef}), which the serializer
1926
+ * (`spec/transaction.ts` `conditionTreeLeaf`) already renders to a `{ $param }`
1927
+ * marker. Widening the leaf here to include `TransactionRef` **only** in the tx
1928
+ * context (via `ConditionInput<TransactionRef>`) aligns the type with that
1929
+ * runtime behaviour without letting a `TransactionRef` leak into non-tx
1930
+ * conditions (whose serializers do not accept it).
1931
+ */
1932
+ type ConditionLeaf<X = never> = Param<unknown> | string | number | boolean | Date | X;
1914
1933
  /** A declarative operator object on one condition field (subset of FilterInput). */
1915
- interface ConditionOperatorObject {
1916
- readonly eq?: ConditionLeaf;
1917
- readonly ne?: ConditionLeaf;
1918
- readonly gt?: ConditionLeaf;
1919
- readonly ge?: ConditionLeaf;
1920
- readonly lt?: ConditionLeaf;
1921
- readonly le?: ConditionLeaf;
1922
- readonly between?: readonly [ConditionLeaf, ConditionLeaf];
1923
- readonly in?: readonly ConditionLeaf[];
1924
- readonly beginsWith?: ConditionLeaf;
1925
- readonly contains?: ConditionLeaf;
1926
- readonly notContains?: ConditionLeaf;
1934
+ interface ConditionOperatorObject<X = never> {
1935
+ readonly eq?: ConditionLeaf<X>;
1936
+ readonly ne?: ConditionLeaf<X>;
1937
+ readonly gt?: ConditionLeaf<X>;
1938
+ readonly ge?: ConditionLeaf<X>;
1939
+ readonly lt?: ConditionLeaf<X>;
1940
+ readonly le?: ConditionLeaf<X>;
1941
+ readonly between?: readonly [ConditionLeaf<X>, ConditionLeaf<X>];
1942
+ readonly in?: readonly ConditionLeaf<X>[];
1943
+ readonly beginsWith?: ConditionLeaf<X>;
1944
+ readonly contains?: ConditionLeaf<X>;
1945
+ readonly notContains?: ConditionLeaf<X>;
1927
1946
  readonly attributeExists?: boolean;
1928
1947
  readonly attributeType?: string;
1929
1948
  }
1930
- type ConditionInput = {
1949
+ type ConditionInput<X = never> = {
1931
1950
  readonly notExists: true;
1932
1951
  } | {
1933
1952
  readonly attributeExists: string;
1934
1953
  } | {
1935
1954
  readonly attributeNotExists: string;
1936
- } | RawCondition | ConditionTree;
1955
+ } | RawCondition | ConditionTree<X>;
1937
1956
  /** A recursive declarative condition tree (field clauses + logical groups). */
1938
- interface ConditionTree {
1939
- readonly and?: readonly ConditionInput[];
1940
- readonly or?: readonly ConditionInput[];
1941
- readonly not?: ConditionInput;
1942
- readonly [field: string]: ConditionLeaf | ConditionOperatorObject | readonly ConditionInput[] | ConditionInput | undefined;
1957
+ interface ConditionTree<X = never> {
1958
+ readonly and?: readonly ConditionInput<X>[];
1959
+ readonly or?: readonly ConditionInput<X>[];
1960
+ readonly not?: ConditionInput<X>;
1961
+ readonly [field: string]: ConditionLeaf<X> | ConditionOperatorObject<X> | readonly ConditionInput<X>[] | ConditionInput<X> | undefined;
1943
1962
  }
1944
1963
  /** Options accepted by the write `define*` entry points (issue #46). */
1945
1964
  interface WriteDefinitionOptions {
@@ -2904,6 +2923,45 @@ type FragmentInput = Readonly<Record<string, MutationInputRef | string | number
2904
2923
  * assembler validates every leaf via {@link assertFaithfulInput}.
2905
2924
  */
2906
2925
  type DescriptorBinding = Readonly<Record<string, unknown>>;
2926
+ /** A concrete scalar admissible at a condition operand leaf. */
2927
+ type ConditionScalar = MutationInputRef | string | number | boolean | Date | null;
2928
+ /** A declarative operator object on one condition field (the #114-A subset). */
2929
+ interface FragmentConditionOperatorObject {
2930
+ readonly eq?: ConditionScalar;
2931
+ readonly ne?: ConditionScalar;
2932
+ readonly gt?: ConditionScalar;
2933
+ readonly ge?: ConditionScalar;
2934
+ readonly lt?: ConditionScalar;
2935
+ readonly le?: ConditionScalar;
2936
+ readonly between?: readonly [ConditionScalar, ConditionScalar];
2937
+ readonly in?: readonly ConditionScalar[];
2938
+ readonly beginsWith?: ConditionScalar;
2939
+ readonly contains?: ConditionScalar;
2940
+ readonly notContains?: ConditionScalar;
2941
+ readonly attributeExists?: boolean;
2942
+ }
2943
+ /**
2944
+ * A declarative write **condition** authored on a {@link WriteDescriptor} (issue
2945
+ * #242, Phase 2) — the same #114-A subset the #101 public write descriptor and
2946
+ * `defineCommands` support, but with {@link MutationInputRef} (`$.field`) leaves
2947
+ * (the mutation authoring form's placeholder) rather than `param.*` / concrete
2948
+ * values. It is a recursive tree of field clauses (bare equality or an operator
2949
+ * object) and `and` / `or` / `not` logical groups. The compiler translates each
2950
+ * `$.field` leaf into a {@link import('./contract.js').ContractParamRef} so the
2951
+ * existing serializer / runtime consume it unchanged.
2952
+ *
2953
+ * A cross-fragment reference (`$.alias.field`) is **not** admissible in a
2954
+ * condition — a `TransactWriteItems` cannot read one item's value mid-transaction
2955
+ * to gate another, and a condition on the fragment's own row can only reference
2956
+ * that row's persisted attributes vs. the command input. Such a leaf is a loud
2957
+ * build error ({@link assertFaithfulCondition}).
2958
+ */
2959
+ interface FragmentCondition {
2960
+ readonly and?: readonly FragmentCondition[];
2961
+ readonly or?: readonly FragmentCondition[];
2962
+ readonly not?: FragmentCondition;
2963
+ readonly [field: string]: ConditionScalar | FragmentConditionOperatorObject | readonly FragmentCondition[] | FragmentCondition | undefined;
2964
+ }
2907
2965
  /**
2908
2966
  * One recorded write fragment (proposal §3): an **intent** + a target entity + an
2909
2967
  * optional adopted save contract (`use:`) + the input binding. It is a
@@ -2922,6 +2980,21 @@ interface MutationFragment {
2922
2980
  readonly entity: EntityRef;
2923
2981
  readonly input: FragmentInput;
2924
2982
  readonly use?: EntityWritesDefinition;
2983
+ /**
2984
+ * The declarative write **condition** (gate) authored on the descriptor (issue
2985
+ * #242, Phase 2). It is the #114-A subset — bare field equality, an operator
2986
+ * object (`{ gt }`, `{ between }`, `{ in }`, …), and the `and` / `or` / `not`
2987
+ * logical groups — whose value leaves are {@link MutationInputRef} (`$.field`)
2988
+ * references or concrete literals. It is carried **verbatim** here (the mutation
2989
+ * assembler only validates the leaf shapes; see {@link assertFaithfulCondition});
2990
+ * the compiler ({@link import('../spec/mutation-command.js').compileFragment})
2991
+ * translates each `$.field` leaf into a {@link
2992
+ * import('./contract.js').ContractParamRef} and attaches it to the compiled base
2993
+ * op's `condition`, so the **existing** condition serializer / runtime consume it
2994
+ * exactly as a #101 public write descriptor's condition does. `undefined` when
2995
+ * the descriptor declared no `condition`.
2996
+ */
2997
+ readonly condition?: FragmentCondition;
2925
2998
  }
2926
2999
  /** Runtime guard: is `value` a {@link MutationFragment}? */
2927
3000
  declare function isMutationFragment(value: unknown): value is MutationFragment;
@@ -2944,10 +3017,17 @@ type ModelRef = ModelStatic<DDBModel> | (new (...args: unknown[]) => unknown) |
2944
3017
  * - `key` — the target row's primary-key binding (identifies the row);
2945
3018
  * - `input` — the non-key field binding (the body / changed fields). Optional for
2946
3019
  * a `remove` (a delete writes no fields);
2947
- * - `condition` — an optional declarative write gate (accepted for authoring
2948
- * parity with the #101 descriptor; threaded by #101's in-process executor the
2949
- * declaration-DSL compiler does not consume it, so the serialized IR is
2950
- * unchanged);
3020
+ * - `condition` — an optional declarative write gate (issue #242, Phase 2). It is
3021
+ * the #114-A condition subset (bare equality, operator objects `{ gt }` / `{ in }`
3022
+ * / `{ between }` / …, and `and` / `or` / `not` groups) whose operand leaves are
3023
+ * `$.field` input references or literals. The declaration-DSL compiler **consumes**
3024
+ * it: each `$.field` leaf becomes a {@link import('./contract.js').ContractParamRef}
3025
+ * and the tree is attached to the compiled base op's `condition`, so it is
3026
+ * serialized (into the operation spec) and evaluated at runtime exactly as a #101
3027
+ * public write descriptor's / `defineCommands` condition is (single-op, in-process
3028
+ * transaction, and the Python bridge). A conditioned `update` / `remove` therefore
3029
+ * fails a CAS-style write when the gate does not hold, rather than silently
3030
+ * committing;
2951
3031
  * - `result` — an optional read-back projection `{ select, options? }` (likewise
2952
3032
  * accepted for authoring parity; the public read-back projection of a
2953
3033
  * `command(...).plan(...)` method is still declared on `command({ select })`).
@@ -2962,8 +3042,11 @@ interface WriteDescriptor {
2962
3042
  readonly key: DescriptorBinding;
2963
3043
  /** The non-key field binding; optional (a `remove` writes no fields). */
2964
3044
  readonly input?: DescriptorBinding;
2965
- /** Optional declarative write gate (accepted for #101 parity; see above). */
2966
- readonly condition?: DescriptorBinding;
3045
+ /**
3046
+ * Optional declarative write gate — the #114-A condition subset (issue #242,
3047
+ * Phase 2). Compiled, serialized, and evaluated at runtime; see the interface doc.
3048
+ */
3049
+ readonly condition?: FragmentCondition;
2967
3050
  /** Optional read-back projection `{ select, options? }` (accepted for #101 parity). */
2968
3051
  readonly result?: {
2969
3052
  readonly select?: unknown;
@@ -3752,14 +3835,65 @@ type LeafValueOf<L> = L extends Param<infer V> ? V : L;
3752
3835
  type KeyOf<KeyRec> = {
3753
3836
  readonly [F in keyof KeyRec]: LeafValueOf<KeyRec[F]>;
3754
3837
  };
3755
- /** The params a descriptor method accepts: the union of its `key` + `input` leaf value types. */
3838
+ /** The params a descriptor method accepts: the union of its `key` + `input` + `condition` leaf value types. */
3756
3839
  type DescriptorParamsOf<D> = (D extends {
3757
3840
  readonly key: infer K;
3758
3841
  } ? KeyOf<K> : Record<never, never>) & (D extends {
3759
3842
  readonly input: infer I;
3760
3843
  } ? {
3761
3844
  readonly [F in keyof I]: LeafValueOf<I[F]>;
3762
- } : Record<never, never>);
3845
+ } : Record<never, never>) & (D extends {
3846
+ readonly condition: infer C;
3847
+ } ? ConditionParamsOf<C> : Record<never, never>);
3848
+ /**
3849
+ * The `param.*` bindings a descriptor `condition` contributes to the method's
3850
+ * `params` argument (issue #243). Every `param.*` at a condition operand position
3851
+ * is minted (at runtime, by `descriptorConditionRecord`) into a named binding using
3852
+ * the shared {@link conditionParamName} / `condParamName` scheme; this type mirrors
3853
+ * that naming so a caller must supply exactly those params:
3854
+ * - a bare-equality clause / single-operand operator → keyed by the field name;
3855
+ * - `between` → `{field}_lo` / `{field}_hi`; `in` → `{field}_0`, `{field}_1`, …;
3856
+ * - `size` → `{field}_size`;
3857
+ * - `and` / `or` / `not` groups recurse; a raw `cond` → positional `cond_p0`, ….
3858
+ */
3859
+ type ConditionParamsOf<C> = C extends {
3860
+ readonly [RAW_COND]: true;
3861
+ readonly parts: infer P;
3862
+ } ? RawCondParamsOf<P> : C extends readonly unknown[] ? never : C extends object ? UnionToIntersection<ConditionEntryParamsOf<C, keyof C>> extends infer R ? R : Record<never, never> : Record<never, never>;
3863
+ /** Per-key expansion of a condition object's param bindings (distributes over `K`). */
3864
+ type ConditionEntryParamsOf<C, K extends keyof C> = K extends 'and' | 'or' ? C[K] extends readonly (infer Sub)[] ? ConditionParamsOf<Sub> : Record<never, never> : K extends 'not' ? ConditionParamsOf<C[K]> : K extends string ? FieldClauseParamsOf<K & string, C[K]> : Record<never, never>;
3865
+ /** The param bindings a single field clause (`{ field: leaf | operatorObject }`) contributes. */
3866
+ type FieldClauseParamsOf<Field extends string, V> = V extends Param<infer PV> ? {
3867
+ readonly [P in Field]: PV;
3868
+ } : V extends object ? UnionToIntersection<OperatorParamsOf<Field, V, keyof V>> : Record<never, never>;
3869
+ /** Per-operator expansion of an operator object's param bindings. */
3870
+ type OperatorParamsOf<Field extends string, V, Op extends keyof V> = Op extends 'between' ? V[Op] extends readonly [infer Lo, infer Hi] ? (Lo extends Param<infer LV> ? {
3871
+ readonly [P in `${Field}_lo`]: LV;
3872
+ } : Record<never, never>) & (Hi extends Param<infer HV> ? {
3873
+ readonly [P in `${Field}_hi`]: HV;
3874
+ } : Record<never, never>) : Record<never, never> : Op extends 'in' ? V[Op] extends readonly unknown[] ? InParamsOf<Field, V[Op]> : Record<never, never> : Op extends 'size' ? V[Op] extends Param<infer SV> ? {
3875
+ readonly [P in `${Field}_size`]: SV;
3876
+ } : Record<never, never> : Op extends 'attributeExists' | 'attributeType' ? Record<never, never> : V[Op] extends Param<infer OV> ? {
3877
+ readonly [P in Field]: OV;
3878
+ } : Record<never, never>;
3879
+ /** Positional `{field}_0`, `{field}_1`, … bindings for an `in` operand tuple. */
3880
+ type InParamsOf<Field extends string, T extends readonly unknown[], Acc extends unknown[] = []> = T extends readonly [
3881
+ infer Head,
3882
+ ...infer Tail
3883
+ ] ? (Head extends Param<infer HV> ? {
3884
+ readonly [P in `${Field}_${Acc['length']}`]: HV;
3885
+ } : Record<never, never>) & InParamsOf<Field, Tail, [...Acc, unknown]> : Record<never, never>;
3886
+ /**
3887
+ * Positional `cond_p0`, `cond_p1`, … bindings for a raw `cond` fragment's `param.*`
3888
+ * value slots. The index counts ONLY `param.*` slots (matching `condParamName` /
3889
+ * `collectRawConditionParams`, where a column ref and an embedded literal never
3890
+ * advance the counter), so `cond_pN` names the N-th param slot in occurrence order.
3891
+ */
3892
+ type RawCondParamsOf<P, Acc extends unknown[] = []> = P extends readonly [infer Head, ...infer Tail] ? Head extends Param<infer HV> ? {
3893
+ readonly [K in `cond_p${Acc['length']}`]: HV;
3894
+ } & RawCondParamsOf<Tail, [...Acc, unknown]> : RawCondParamsOf<Tail, Acc> : Record<never, never>;
3895
+ /** Collapse a union of records into their intersection (all bindings required together). */
3896
+ type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
3763
3897
  /** The result of a read descriptor: a projected item (`query` → item | null, `list` → connection). */
3764
3898
  type ReadDescriptorResultOf<D> = D extends {
3765
3899
  readonly query: infer M;
@@ -3916,7 +4050,7 @@ interface PublicWriteDescriptor {
3916
4050
  readonly remove?: ModelRef;
3917
4051
  readonly key: Readonly<Record<string, unknown>>;
3918
4052
  readonly input?: Readonly<Record<string, unknown>>;
3919
- readonly condition?: Readonly<Record<string, unknown>>;
4053
+ readonly condition?: Readonly<Record<string, unknown>> | RawCondition<any, any>;
3920
4054
  readonly result?: {
3921
4055
  readonly select?: Readonly<Record<string, boolean>>;
3922
4056
  readonly options?: unknown;
@@ -4537,6 +4671,21 @@ interface WhenSpec {
4537
4671
  * `attribute_exists`).
4538
4672
  */
4539
4673
  type TransactionItemType = 'Put' | 'Update' | 'Delete' | 'ConditionCheck';
4674
+ /**
4675
+ * A value leaf of a transaction `item` / `changes` / `add` map (issue #245).
4676
+ *
4677
+ * - a **string** carries a template: a `{param}` / `{item.field}` placeholder, a
4678
+ * composite (`PREFIX#{param}`), or a plain string literal — resolved by the
4679
+ * runtimes' template machinery (a whole-placeholder string keeps the bound
4680
+ * param's *type*, a composite / plain string resolves to a string);
4681
+ * - a **number** / **boolean** carries a *typed literal* verbatim, so a numeric
4682
+ * literal in a `put` item / `update` changes (`version: 0`) survives to DynamoDB
4683
+ * as an `N` / `BOOL` instead of being stringified to an `S` (the pre-#245 bug).
4684
+ *
4685
+ * A `Date` literal is serialized to its ISO-8601 **string** at build time (a
4686
+ * `@datetime` / `@date` field is stored as `S`), so it stays a string leaf.
4687
+ */
4688
+ type TransactionValueLeaf = string | number | boolean;
4540
4689
  /**
4541
4690
  * A single templated item in a transaction. When `forEach` is present, the item
4542
4691
  * is expanded **once per element** of the named array param, with each element's
@@ -4562,19 +4711,27 @@ interface TransactionItemSpec {
4562
4711
  readonly type: TransactionItemType;
4563
4712
  readonly tableName: string;
4564
4713
  readonly entity: string;
4565
- /** Put: the full item template (field → template / literal). */
4566
- readonly item?: Readonly<Record<string, string>>;
4714
+ /**
4715
+ * Put: the full item template (field → template / typed literal). A string
4716
+ * value is a template ({@link TransactionValueLeaf}); a `number` / `boolean` is
4717
+ * a typed literal carried verbatim (issue #245).
4718
+ */
4719
+ readonly item?: Readonly<Record<string, TransactionValueLeaf>>;
4567
4720
  /** Update / Delete / ConditionCheck: the key template (attribute → template). */
4568
4721
  readonly keyCondition?: Readonly<Record<string, string>>;
4569
- /** Update: field-level `SET` change templates (overwrite). */
4570
- readonly changes?: Readonly<Record<string, string>>;
4722
+ /**
4723
+ * Update: field-level `SET` change templates (overwrite). A string value is a
4724
+ * template; a `number` / `boolean` is a typed literal carried verbatim (#245).
4725
+ */
4726
+ readonly changes?: Readonly<Record<string, TransactionValueLeaf>>;
4571
4727
  /**
4572
4728
  * Update: field-level atomic `ADD` deltas (issue #85, derived counters). Each
4573
- * value is a numeric template (`{param}` / a literal number string); the runtime
4574
- * applies `ADD #field :delta`, an atomic increment that needs no prior read and
4575
- * is safe under concurrency. A negative delta decrements (e.g. `-1` on a remove).
4729
+ * value is a numeric template (`{param}` / a literal number string) or a typed
4730
+ * numeric literal (issue #245); the runtime applies `ADD #field :delta`, an
4731
+ * atomic increment that needs no prior read and is safe under concurrency. A
4732
+ * negative delta decrements (e.g. `-1` on a remove).
4576
4733
  */
4577
- readonly add?: Readonly<Record<string, string>>;
4734
+ readonly add?: Readonly<Record<string, TransactionValueLeaf>>;
4578
4735
  /**
4579
4736
  * The write / assertion condition (subset). Optional on `Put` / `Update` /
4580
4737
  * `Delete`; **required** on a `ConditionCheck` (the assertion it makes).
@@ -6096,7 +6253,9 @@ declare function executeCommandMethod(contract: ExecutableCommandContract, metho
6096
6253
  *
6097
6254
  * - **READ** — `{ alias: { query | list: Model, key, select, options? } }`. Each
6098
6255
  * route runs **independently and in parallel** (`Promise.all`): a `query` route
6099
- * delegates to {@link executeQuery}, a `list` route to {@link executeList}. The
6256
+ * delegates to {@link executeAdHocQuery}, a `list` route to
6257
+ * {@link executeAdHocList} — the unified read-plan lowering (issue #249), the
6258
+ * same path `Model.query` / `Model.list` and `prepare` execute through. The
6100
6259
  * nested selection / relation resolution / optimisation under a route is the
6101
6260
  * existing read path, reused verbatim. Cross-route consistency is NOT guaranteed
6102
6261
  * (each route is its own read).
@@ -6276,6 +6435,96 @@ type MutateParallelResult<E extends WriteEnvelope> = {
6276
6435
  readonly [K in keyof E]: BulkWrap<E[K], ParallelResultOf<E[K]>>;
6277
6436
  };
6278
6437
 
6438
+ /**
6439
+ * The unified internal READ plan (issue #249) — every read surface lowers to ONE
6440
+ * internal route representation ({@link CompiledReadRoute}) and executes through
6441
+ * ONE executor ({@link executeCompiledReadRoute}).
6442
+ *
6443
+ * Before #249, reads had two paths: the prepared / AOT path lowered a declarative
6444
+ * route to a {@link CompiledReadRoute} (param-slot IR) and executed it, while the
6445
+ * ad-hoc surfaces (`Model.query` / `Model.list` / the `DDBModel.query` envelope)
6446
+ * called `executeQuery` / `executeList` DIRECTLY — the same surface-dependent
6447
+ * divergence that let #242/#243-class silent drops happen on the write side. This
6448
+ * module closes the read side:
6449
+ *
6450
+ * - {@link executeCompiledReadRoute} is the SINGLE funnel from a lowered route to
6451
+ * the physical read cores (`executeQuery` / `executeList`). The prepared
6452
+ * statement ({@link import('./prepared.js').PreparedReadStatement}), the AOT
6453
+ * loader, and the ad-hoc surfaces all execute through it — no read surface
6454
+ * calls the cores directly anymore.
6455
+ * - {@link executeAdHocQuery} / {@link executeAdHocList} lower an ad-hoc call to a
6456
+ * {@link CompiledReadRoute} first (each key FIELD becomes a same-named param
6457
+ * slot; the concrete values bind as params at execution — exactly the prepared
6458
+ * path's shape), then run the shared executor.
6459
+ *
6460
+ * ## Ad-hoc semantics are preserved EXACTLY
6461
+ *
6462
+ * The lowering adds a plan representation, never a behavior change: the caller's
6463
+ * option bag is threaded through verbatim (a shallow copy — including fields the
6464
+ * plan layer does not know about, so read middleware R1 hooks observe the same
6465
+ * bag), the select spec is passed through untouched (the physical cores own
6466
+ * `project(...)`-builder normalization / validation, as before), and per-call
6467
+ * host-side options (`updatable` / `hydrate` / `retry` / `context`) flow through
6468
+ * unchanged. A prepared route's slot-bound options take precedence over the
6469
+ * per-call bag — the prepared surface only ever passes `retry` / `context`
6470
+ * per-call, so both surfaces keep their existing semantics through the one
6471
+ * executor.
6472
+ *
6473
+ * ## Structural memoization (the #206-style hot-path guarantee)
6474
+ *
6475
+ * The ad-hoc lowering is memoized in a bounded LRU keyed by the query's
6476
+ * **structure** — model OBJECT identity (never a class name), route kind, key
6477
+ * field NAMES (values are params, not part of the key), and the select shape
6478
+ * (builder-aware; literal filter/option values inside a select are part of the
6479
+ * shape) — so the plan is compiled once per `(model, shape)`, not per call. A
6480
+ * select shape the serializer cannot prove stable (a function / symbol / class
6481
+ * instance at a leaf) is compiled fresh per call instead of risking a cache
6482
+ * collision — correctness over reuse.
6483
+ */
6484
+
6485
+ /**
6486
+ * A recorded binding: a value is either a param slot (bind from `params[name]`)
6487
+ * or a static literal (used verbatim). Discovered ONCE at lowering, replayed per
6488
+ * execution. Exported (@internal) for the prepared runtime
6489
+ * (`src/runtime/prepared.ts`), the #208 AOT emitter (`src/spec/prepared.ts`) and
6490
+ * loader (`src/runtime/prepared-loader.ts`), which serialize / rebind exactly
6491
+ * this structure.
6492
+ */
6493
+ type Slot = {
6494
+ readonly kind: 'param';
6495
+ readonly name: string;
6496
+ } | {
6497
+ readonly kind: 'literal';
6498
+ readonly value: unknown;
6499
+ };
6500
+ /**
6501
+ * The unified internal read plan — one `query` / `list` route lowered to its
6502
+ * params-independent products (resolved model class, select spec, key param
6503
+ * slots, static / slot-bound options). EVERY read surface produces one of these
6504
+ * before execution: the prepared runtime (`compileReadRoute`), the #208 AOT
6505
+ * loader (which reconstructs routes from the static plan artifact), and — since
6506
+ * #249 — the ad-hoc surfaces (`Model.query` / `Model.list` / the `DDBModel.query`
6507
+ * envelope) via {@link executeAdHocQuery} / {@link executeAdHocList}.
6508
+ * @internal
6509
+ */
6510
+ interface CompiledReadRoute {
6511
+ readonly alias: string;
6512
+ readonly kind: 'query' | 'list';
6513
+ readonly modelClass: Function;
6514
+ /** The static select spec (params-independent; may be a `project(...)` builder
6515
+ * on the ad-hoc surface — the physical cores own its normalization). */
6516
+ readonly select: Record<string, unknown>;
6517
+ readonly keySlots: Readonly<Record<string, Slot>>;
6518
+ /** Static option literals decided at lowering (maxDepth / order / filter). */
6519
+ readonly maxDepth?: number;
6520
+ readonly order?: 'ASC' | 'DESC';
6521
+ readonly filter?: Record<string, unknown>;
6522
+ /** Dynamic option slots (may bind a param or a literal). */
6523
+ readonly consistentReadSlot?: Slot;
6524
+ readonly limitSlot?: Slot;
6525
+ readonly afterSlot?: Slot;
6526
+ }
6527
+
6279
6528
  /**
6280
6529
  * Prepared statements — `DDBModel.prepare($ => ({...}))` → `.execute(params)`
6281
6530
  * (issue #205, design #203). The **runtime, fallback-B** implementation of the
@@ -6302,8 +6551,9 @@ type MutateParallelResult<E extends WriteEnvelope> = {
6302
6551
  * - **read** — the params-independent products (resolved model class, normalized
6303
6552
  * select + static filter, key-field NAMES, validated relation structure) are
6304
6553
  * computed once. `execute` binds the concrete key VALUES + per-call pagination /
6305
- * consistency and calls {@link executeQuery} / {@link executeListInternal} — the
6306
- * identical core `Model.query` / `Model.list` and `publicQueryModel` use. (The
6554
+ * consistency and runs the unified read-plan executor
6555
+ * (`executeCompiledReadRoute`, issue #249) — the identical core `Model.query` /
6556
+ * `Model.list` and `publicQueryModel` use. (The
6307
6557
  * `ExecutionPlan` bakes concrete key values into its `keyCondition`, so a single
6308
6558
  * compiled operation object is NOT reusable across param sets; the precompiled
6309
6559
  * product is the resolved model + normalized projection — exactly what the public
@@ -6413,20 +6663,6 @@ interface PreparedReadExecOptions {
6413
6663
  readonly retry?: RetryOverride;
6414
6664
  readonly context?: RequestContext;
6415
6665
  }
6416
- /**
6417
- * A recorded binding: a value is either a param slot (bind from `params[name]`) or
6418
- * a static literal (used verbatim). Discovered ONCE at prepare from the recording
6419
- * `$` proxy, replayed per `execute`. Exported (@internal) for the #208 AOT
6420
- * emitter (`src/spec/prepared.ts`) and loader (`src/runtime/prepared-loader.ts`),
6421
- * which serialize / rebind exactly this structure.
6422
- */
6423
- type Slot = {
6424
- readonly kind: 'param';
6425
- readonly name: string;
6426
- } | {
6427
- readonly kind: 'literal';
6428
- readonly value: unknown;
6429
- };
6430
6666
  interface CompiledWriteOp {
6431
6667
  readonly alias: string;
6432
6668
  readonly intent: Intent;
@@ -6436,25 +6672,6 @@ interface CompiledWriteOp {
6436
6672
  readonly conditionSlots?: Readonly<Record<string, Slot>>;
6437
6673
  readonly result?: PreparedWriteRoute['result'];
6438
6674
  }
6439
- /** @internal — exported for the #208 AOT loader, which reconstructs these
6440
- * routes from the static plan artifact and executes them through the SAME
6441
- * {@link PreparedReadStatement}. */
6442
- interface CompiledReadRoute {
6443
- readonly alias: string;
6444
- readonly kind: 'query' | 'list';
6445
- readonly modelClass: Function;
6446
- /** The normalized static select spec (params-independent). */
6447
- readonly select: Record<string, unknown>;
6448
- readonly keySlots: Readonly<Record<string, Slot>>;
6449
- /** Static option literals decided at prepare (maxDepth / order / filter). */
6450
- readonly maxDepth?: number;
6451
- readonly order?: 'ASC' | 'DESC';
6452
- readonly filter?: Record<string, unknown>;
6453
- /** Dynamic option slots (may bind a param or a literal). */
6454
- readonly consistentReadSlot?: Slot;
6455
- readonly limitSlot?: Slot;
6456
- readonly afterSlot?: Slot;
6457
- }
6458
6675
  /** A prepared **write** handle. `execute(params)` binds + runs the shared write core. */
6459
6676
  declare class PreparedWriteStatement {
6460
6677
  private readonly ops;
@@ -7380,4 +7597,4 @@ interface ViewDefinition {
7380
7597
  */
7381
7598
  declare function collectViewDefinitions(registry?: ReadonlyMap<Function, EntityMetadata>): ViewDefinition[];
7382
7599
 
7383
- export { type AnyOperationDefinition as $, type ContractSpec as A, type BatchResult as B, type CdcEmulatorOptions as C, type DynamoDBOperation as D, type EventLog as E, type FaultSpec as F, type QuerySpec as G, type CommandSpec as H, type TransactionSpec as I, type ContextSpec as J, SPEC_VERSION as K, type ParamSpec as L, type ModelStatic as M, type ParamDescriptor as N, type EntityRef as O, type PutInput as P, type QueryModelContract as Q, type ReplayOptions as R, type ShardId as S, type TransactWriteExecItem as T, type Unsubscribe as U, type ViewDefinition as V, type WriteExecOptions as W, type ConditionInput as X, type Param as Y, type DefinitionMap as Z, type OperationsDocument as _, type CdcMode as a, type FieldOptions as a$, type Manifest as a0, type BridgeBundle as a1, type ConditionSpec as a2, type PreparedBody as a3, type CommandContractMethodSpec as a4, type CommandResolutionTarget as a5, type CompiledFragment as a6, type CompiledMutationPlan as a7, type ComposeSpec as a8, type CompositionPlanSpec as a9, type QueryContractMethodSpec as aA, type RangeConditionSpec as aB, type ReadOperationType as aC, type TransactionItemSpec as aD, type TransactionItemType as aE, type WhenSpec as aF, type WriteOperationType as aG, assertNoCrossFragmentMaintainCollision as aH, compileFragment as aI, compileMutationPlan as aJ, compileSingleFragmentPlan as aK, resetMaintenanceGraphCache as aL, resolveLifecycle as aM, resolveMaintainers as aN, type SelectableOf as aO, type PrimaryKeyOf as aP, type RequestContext as aQ, type Middleware as aR, type ReadRequestKind as aS, type CtxModel as aT, type ReadParams as aU, type ReadRequestCtx as aV, type Item as aW, type RetryPolicy as aX, type KeyDefinition as aY, type GsiDefinition as aZ, type ModelKind as a_, type ContractCardinality as aa, type ContractCommandResult as ab, type ContractInputArity as ac, type ContractKeySpec as ad, type ContractKind as ae, type ContractResolution as af, type DerivedConditionCheck as ag, type DerivedEdgeWrite as ah, type DerivedIdempotencyGuard as ai, type DerivedMaintainOutbox as aj, type DerivedMaintainWrite as ak, type DerivedOutboxEvent as al, type DerivedUniqueGuard as am, type DerivedUpdate as an, type EntityRefResolver as ao, type ExecutionPlanSpec as ap, type FilterSpec as aq, MAX_TRANSACT_COMPOSE_ITEMS as ar, type ManifestEntity as as, type ManifestField as at, type ManifestFieldType as au, type ManifestGsi as av, type ManifestKey as aw, type ManifestRelation as ax, type ManifestTable as ay, type OperationSpec as az, type ChangeBatch as b, type ContractQueryParams as b$, type DynamoType as b0, type ProjectionTransform as b1, type MaintainEvent as b2, type MembershipPredicate as b3, type MaintainConsistency as b4, type MaintainUpdateMode as b5, type MembershipPredicateOp as b6, type RelationOptions as b7, type AggregateOptions as b8, type AggregateValue as b9, type BatchWriteRequest as bA, CONTRACT_RANGE_FANOUT_CONCURRENCY as bB, type CdcModelRegistry as bC, type CdcSubscribeHandlers as bD, type Change as bE, type CollectionEffect as bF, type CollectionOptions as bG, type Column as bH, type ColumnMap as bI, type CommandInputShape as bJ, type CommandMethod as bK, type CommandPlan as bL, type CommandResultKind as bM, type CommandSelectShape as bN, type CondSlot as bO, type ConditionCheckInput as bP, type Connection as bQ, type ContractCallSignature as bR, type ContractCommandParams as bS, type ContractComposeNode as bT, type ContractFromRef as bU, type ContractItem as bV, type ContractKeyFieldRef as bW, type ContractKeyInput as bX, type ContractKeyRef as bY, type ContractMethodOp as bZ, type ContractParamRef as b_, type SelectBuilderSpec as ba, type RawCondition as bb, type RetryOverride as bc, type ExecutionPlan as bd, type FieldMetadata as be, type ResolvedKey as bf, type Slot as bg, type PreparedWriteExecOptions as bh, type CommandReturn as bi, type ParallelOpResult as bj, type PreparedStatement as bk, type RelationMetadata as bl, type MaintainEffect as bm, type OperationDefinition as bn, type WriteDefinitionOptions as bo, type PartialQueryKeyOf as bp, type StrictSelectSpec as bq, type ReadDefinitionOptions as br, type EntityInput as bs, type UniqueQueryKeyOf as bt, type AggregateMetadata as bu, type BatchDeleteRequest as bv, type BatchGetOptions as bw, type BatchGetRequest as bx, BatchGetResult as by, type BatchPutRequest as bz, type ChangeEvent as c, PreparedWriteStatement as c$, type CounterAggregate as c0, type CounterEffect as c1, type CtxBase as c2, DEFAULT_MAX_ATTEMPTS as c3, DEFAULT_RETRY_POLICY as c4, type DeleteOptions as c5, type DeriveEffect as c6, type DescriptorBinding as c7, ENTITY_WRITES_MARKER as c8, type EdgeEffect as c9, type MaintenanceGraph as cA, type MembershipEffect as cB, type ModelRef as cC, type MutateMode as cD, type MutateOptions as cE, type MutateParallelResult as cF, type MutateTransactionResult as cG, type MutationBody as cH, type MutationDescriptorMap as cI, type MutationFragment as cJ, type MutationInputProxy as cK, type MutationInputRef as cL, type MutationIntent as cM, type NumberParam as cN, type OperationKind as cO, PREPARE_CACHE_MAX as cP, type ParamKind as cQ, type ParamStructure as cR, type PersistCtx as cS, type PersistOrigin as cT, type PlannedCommandMethod as cU, type PreparedInputProxy as cV, type PreparedParamRef as cW, type PreparedReadExecOptions as cX, type PreparedReadRoute as cY, PreparedReadStatement as cZ, type PreparedWriteRoute as c_, type EffectPath as ca, type EmbeddedMetadata as cb, type EmitEffect as cc, type EntityWritesDefinition as cd, type EntityWritesShape as ce, type ExecutableCommandContract as cf, type ExecutableQueryContract as cg, type FilterInput as ch, type FragmentInput as ci, type GsiDefinitionMarker as cj, type GsiOptions as ck, type IdempotencyEffect as cl, type InProcessWriteDescriptor as cm, type InlineSnapshotSpec as cn, type InputArity as co, type KeyDefinitionMarker as cp, type KeySegment as cq, type KeySlot as cr, type KeyStructure as cs, type KeyedResult as ct, LIFECYCLE_CONTRACT_MARKER as cu, type LifecycleContract as cv, type LifecycleEffects as cw, type LiteralParam as cx, type MaintainItem as cy, type MaintainTrigger as cz, type ChangeEventName as d, executeKeyedBatchGet as d$, type ProjectionMap as d0, type ProjectionTransformOp as d1, type PutOptions as d2, type QueryEnvelopeResult as d3, type QueryKeyOf as d4, type QueryMethod as d5, type QueryResult as d6, type ReadEnvelope as d7, type ReadOpCtx as d8, type ReadOpKind as d9, type UniqueEffect as dA, type Updatable as dB, type UpdateOptions as dC, type ViewSourceSlice as dD, type WriteCtx as dE, type WriteDescriptor as dF, type WriteEnvelope as dG, type WriteInput as dH, type WriteKind as dI, type WriteLifecyclePhase as dJ, type WriteMiddleware as dK, type WriteRecorder as dL, type WriteResultProjection as dM, attachModelClass as dN, buildDeleteInput as dO, buildMaintenanceGraph as dP, buildPutInput as dQ, buildUpdateInput as dR, collectViewDefinitions as dS, cond as dT, contractOfMethodSpec as dU, definePlan as dV, entityWrites as dW, executeBatchGet as dX, executeBatchWrite as dY, executeCommandMethod as dZ, executeDelete as d_, type ReadRouteDescriptor as da, type ReadRouteOptions as db, type ReadRouteResult as dc, type RecordedCompose as dd, type RelationBuilder as de, type RelationConsistency as df, type RelationLimitOptions as dg, type RelationPattern as dh, type RelationProjection as di, type RelationReadOptions as dj, type RelationSelect as dk, type RelationSpec as dl, type RelationUpdateMode as dm, type RelationWriteOptions as dn, type RequiresEffect as dp, type Resolution as dq, type RetryInfo as dr, type RetryOperationKind as ds, type SegmentSpec as dt, type SegmentedKey as du, type SelectBuilder as dv, type SelectOf as dw, type SnapshotEffect as dx, type StringParam as dy, TransactionContext as dz, type ChangeHandler as e, executePut as e0, executeQueryMethod as e1, executeRangeFanout as e2, executeTransaction as e3, executeUpdate as e4, from as e5, getEntityWrites as e6, gsi as e7, identity as e8, isColumn as e9, param as eA, prepare as eB, preview as eC, publicCommandModel as eD, publicQueryModel as eE, query as eF, wholeKeysSentinel as eG, isCommandModelContract as ea, isCommandPlan as eb, isContractComposeNode as ec, isContractFromRef as ed, isContractKeyFieldRef as ee, isContractKeyRef as ef, isContractParamRef as eg, isEntityWritesDefinition as eh, isKeySegment as ei, isLifecycleContract as ej, isMaintainTrigger as ek, isMutationFragment as el, isMutationInputRef as em, isParam as en, isPlannedCommandMethod as eo, isPreparedParamRef as ep, isQueryModelContract as eq, isRetryableError as er, isRetryableTransactionCancellation as es, k as et, key as eu, lifecyclePhaseForIntent as ev, maintainTrigger as ew, mintContractKeyFieldRef as ex, mintContractParamRef as ey, mutation as ez, type ClockMode as f, type ConcurrentRecomputeRef as g, type StartingPosition as h, type StreamViewType as i, type SubscribeHandler as j, type SubscribeHandlers as k, buildSubscribeHandler as l, type EntityMetadata as m, type Executor as n, type ReadExecOptions as o, type ExecutorResult as p, type BatchGetExecInput as q, type WriteResult as r, type UpdateInput as s, type DeleteInput as t, type BatchWriteExecItem as u, type BatchExecOptions as v, DDBModel as w, type QueryMethodSpec as x, type CommandModelContract as y, type CommandMethodSpec as z };
7600
+ export { type AnyOperationDefinition as $, type ContractSpec as A, type BatchResult as B, type CdcEmulatorOptions as C, type DynamoDBOperation as D, type EventLog as E, type FaultSpec as F, type QuerySpec as G, type CommandSpec as H, type TransactionSpec as I, type ContextSpec as J, SPEC_VERSION as K, type ParamSpec as L, type ModelStatic as M, type ParamDescriptor as N, type EntityRef as O, type PutInput as P, type QueryModelContract as Q, type ReplayOptions as R, type ShardId as S, type TransactWriteExecItem as T, type Unsubscribe as U, type ViewDefinition as V, type WriteExecOptions as W, type ConditionInput as X, type Param as Y, type DefinitionMap as Z, type OperationsDocument as _, type CdcMode as a, type ModelKind as a$, type Manifest as a0, type BridgeBundle as a1, type ConditionSpec as a2, type PreparedBody as a3, type CommandContractMethodSpec as a4, type CommandResolutionTarget as a5, type CompiledFragment as a6, type CompiledMutationPlan as a7, type ComposeSpec as a8, type CompositionPlanSpec as a9, type QueryContractMethodSpec as aA, type RangeConditionSpec as aB, type ReadOperationType as aC, type TransactionItemSpec as aD, type TransactionItemType as aE, type WhenSpec as aF, type WriteOperationType as aG, assertNoCrossFragmentMaintainCollision as aH, compileFragment as aI, compileMutationPlan as aJ, compileSingleFragmentPlan as aK, resetMaintenanceGraphCache as aL, resolveLifecycle as aM, resolveMaintainers as aN, type SelectableOf as aO, type PrimaryKeyOf as aP, type RequestContext as aQ, type Middleware as aR, type ReadRequestKind as aS, type CtxModel as aT, type ReadParams as aU, type ReadRequestCtx as aV, type Item as aW, type RetryPolicy as aX, type RetryOverride as aY, type KeyDefinition as aZ, type GsiDefinition as a_, type ContractCardinality as aa, type ContractCommandResult as ab, type ContractInputArity as ac, type ContractKeySpec as ad, type ContractKind as ae, type ContractResolution as af, type DerivedConditionCheck as ag, type DerivedEdgeWrite as ah, type DerivedIdempotencyGuard as ai, type DerivedMaintainOutbox as aj, type DerivedMaintainWrite as ak, type DerivedOutboxEvent as al, type DerivedUniqueGuard as am, type DerivedUpdate as an, type EntityRefResolver as ao, type ExecutionPlanSpec as ap, type FilterSpec as aq, MAX_TRANSACT_COMPOSE_ITEMS as ar, type ManifestEntity as as, type ManifestField as at, type ManifestFieldType as au, type ManifestGsi as av, type ManifestKey as aw, type ManifestRelation as ax, type ManifestTable as ay, type OperationSpec as az, type ChangeBatch as b, type ContractQueryParams as b$, type FieldOptions as b0, type DynamoType as b1, type ProjectionTransform as b2, type MaintainEvent as b3, type MembershipPredicate as b4, type MaintainConsistency as b5, type MaintainUpdateMode as b6, type MembershipPredicateOp as b7, type RelationOptions as b8, type AggregateOptions as b9, type BatchWriteRequest as bA, CONTRACT_RANGE_FANOUT_CONCURRENCY as bB, type CdcModelRegistry as bC, type CdcSubscribeHandlers as bD, type Change as bE, type CollectionEffect as bF, type CollectionOptions as bG, type Column as bH, type ColumnMap as bI, type CommandInputShape as bJ, type CommandMethod as bK, type CommandPlan as bL, type CommandResultKind as bM, type CommandSelectShape as bN, type CondSlot as bO, type ConditionCheckInput as bP, type Connection as bQ, type ContractCallSignature as bR, type ContractCommandParams as bS, type ContractComposeNode as bT, type ContractFromRef as bU, type ContractItem as bV, type ContractKeyFieldRef as bW, type ContractKeyInput as bX, type ContractKeyRef as bY, type ContractMethodOp as bZ, type ContractParamRef as b_, type AggregateValue as ba, type SelectBuilderSpec as bb, type RawCondition as bc, type ExecutionPlan as bd, type FieldMetadata as be, type ResolvedKey as bf, type Slot as bg, type PreparedWriteExecOptions as bh, type CommandReturn as bi, type ParallelOpResult as bj, type PreparedStatement as bk, type RelationMetadata as bl, type MaintainEffect as bm, type OperationDefinition as bn, type WriteDefinitionOptions as bo, type PartialQueryKeyOf as bp, type StrictSelectSpec as bq, type ReadDefinitionOptions as br, type EntityInput as bs, type UniqueQueryKeyOf as bt, type AggregateMetadata as bu, type BatchDeleteRequest as bv, type BatchGetOptions as bw, type BatchGetRequest as bx, BatchGetResult as by, type BatchPutRequest as bz, type ChangeEvent as c, PreparedReadStatement as c$, type CounterAggregate as c0, type CounterEffect as c1, type CtxBase as c2, DEFAULT_MAX_ATTEMPTS as c3, DEFAULT_RETRY_POLICY as c4, type DeleteOptions as c5, type DeriveEffect as c6, type DescriptorBinding as c7, ENTITY_WRITES_MARKER as c8, type EdgeEffect as c9, type MaintainItem as cA, type MaintainTrigger as cB, type MaintenanceGraph as cC, type MembershipEffect as cD, type ModelRef as cE, type MutateMode as cF, type MutateOptions as cG, type MutateParallelResult as cH, type MutateTransactionResult as cI, type MutationBody as cJ, type MutationDescriptorMap as cK, type MutationFragment as cL, type MutationInputProxy as cM, type MutationInputRef as cN, type MutationIntent as cO, type NumberParam as cP, type OperationKind as cQ, PREPARE_CACHE_MAX as cR, type ParamKind as cS, type ParamStructure as cT, type PersistCtx as cU, type PersistOrigin as cV, type PlannedCommandMethod as cW, type PreparedInputProxy as cX, type PreparedParamRef as cY, type PreparedReadExecOptions as cZ, type PreparedReadRoute as c_, type EffectPath as ca, type EmbeddedMetadata as cb, type EmitEffect as cc, type EntityWritesDefinition as cd, type EntityWritesShape as ce, type ExecutableCommandContract as cf, type ExecutableQueryContract as cg, type FilterInput as ch, type FragmentCondition as ci, type FragmentConditionOperatorObject as cj, type FragmentInput as ck, type GsiDefinitionMarker as cl, type GsiOptions as cm, type IdempotencyEffect as cn, type InProcessWriteDescriptor as co, type InlineSnapshotSpec as cp, type InputArity as cq, type KeyDefinitionMarker as cr, type KeySegment as cs, type KeySlot as ct, type KeyStructure as cu, type KeyedResult as cv, LIFECYCLE_CONTRACT_MARKER as cw, type LifecycleContract as cx, type LifecycleEffects as cy, type LiteralParam as cz, type ChangeEventName as d, executeCommandMethod as d$, type PreparedWriteRoute as d0, PreparedWriteStatement as d1, type ProjectionMap as d2, type ProjectionTransformOp as d3, type PutOptions as d4, type QueryEnvelopeResult as d5, type QueryKeyOf as d6, type QueryMethod as d7, type QueryResult as d8, type ReadEnvelope as d9, type StringParam as dA, TransactionContext as dB, type UniqueEffect as dC, type Updatable as dD, type UpdateOptions as dE, type ViewSourceSlice as dF, type WriteCtx as dG, type WriteDescriptor as dH, type WriteEnvelope as dI, type WriteInput as dJ, type WriteKind as dK, type WriteLifecyclePhase as dL, type WriteMiddleware as dM, type WriteRecorder as dN, type WriteResultProjection as dO, attachModelClass as dP, buildDeleteInput as dQ, buildMaintenanceGraph as dR, buildPutInput as dS, buildUpdateInput as dT, collectViewDefinitions as dU, cond as dV, contractOfMethodSpec as dW, definePlan as dX, entityWrites as dY, executeBatchGet as dZ, executeBatchWrite as d_, type ReadOpCtx as da, type ReadOpKind as db, type ReadRouteDescriptor as dc, type ReadRouteOptions as dd, type ReadRouteResult as de, type RecordedCompose as df, type RelationBuilder as dg, type RelationConsistency as dh, type RelationLimitOptions as di, type RelationPattern as dj, type RelationProjection as dk, type RelationReadOptions as dl, type RelationSelect as dm, type RelationSpec as dn, type RelationUpdateMode as dp, type RelationWriteOptions as dq, type RequiresEffect as dr, type Resolution as ds, type RetryInfo as dt, type RetryOperationKind as du, type SegmentSpec as dv, type SegmentedKey as dw, type SelectBuilder as dx, type SelectOf as dy, type SnapshotEffect as dz, type ChangeHandler as e, executeDelete as e0, executeKeyedBatchGet as e1, executePut as e2, executeQueryMethod as e3, executeRangeFanout as e4, executeTransaction as e5, executeUpdate as e6, from as e7, getEntityWrites as e8, gsi as e9, mintContractParamRef as eA, mutation as eB, param as eC, prepare as eD, preview as eE, publicCommandModel as eF, publicQueryModel as eG, query as eH, wholeKeysSentinel as eI, identity as ea, isColumn as eb, isCommandModelContract as ec, isCommandPlan as ed, isContractComposeNode as ee, isContractFromRef as ef, isContractKeyFieldRef as eg, isContractKeyRef as eh, isContractParamRef as ei, isEntityWritesDefinition as ej, isKeySegment as ek, isLifecycleContract as el, isMaintainTrigger as em, isMutationFragment as en, isMutationInputRef as eo, isParam as ep, isPlannedCommandMethod as eq, isPreparedParamRef as er, isQueryModelContract as es, isRetryableError as et, isRetryableTransactionCancellation as eu, k as ev, key as ew, lifecyclePhaseForIntent as ex, maintainTrigger as ey, mintContractKeyFieldRef as ez, type ClockMode as f, type ConcurrentRecomputeRef as g, type StartingPosition as h, type StreamViewType as i, type SubscribeHandler as j, type SubscribeHandlers as k, buildSubscribeHandler as l, type EntityMetadata as m, type Executor as n, type ReadExecOptions as o, type ExecutorResult as p, type BatchGetExecInput as q, type WriteResult as r, type UpdateInput as s, type DeleteInput as t, type BatchWriteExecItem as u, type BatchExecOptions as v, DDBModel as w, type QueryMethodSpec as x, type CommandModelContract as y, type CommandMethodSpec as z };
@@ -1,4 +1,4 @@
1
- import { m as EntityMetadata } from './maintenance-view-adapter-C1HaBX4y.js';
1
+ import { m as EntityMetadata } from './maintenance-view-adapter-BATUh_I8.js';
2
2
 
3
3
  interface LintRule {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { b as Linter, L as LintRule } from './registry-DWhq5wiA.js';
1
+ import { b as Linter, L as LintRule } from './registry-CXhP4TaE.js';
2
2
 
3
3
  /**
4
4
  * Creates a Linter pre-loaded with rules safe for Entity registration.
@@ -1,4 +1,4 @@
1
- export { a1 as BridgeBundle, a4 as CommandContractMethodSpec, a5 as CommandResolutionTarget, H as CommandSpec, a6 as CompiledFragment, a7 as CompiledMutationPlan, a8 as ComposeSpec, a9 as CompositionPlanSpec, a2 as ConditionSpec, J as ContextSpec, aa as ContractCardinality, ab as ContractCommandResult, ac as ContractInputArity, ad as ContractKeySpec, ae as ContractKind, af as ContractResolution, A as ContractSpec, ag as DerivedConditionCheck, ah as DerivedEdgeWrite, ai as DerivedIdempotencyGuard, aj as DerivedMaintainOutbox, ak as DerivedMaintainWrite, al as DerivedOutboxEvent, am as DerivedUniqueGuard, an as DerivedUpdate, ao as EntityRefResolver, ap as ExecutionPlanSpec, aq as FilterSpec, ar as MAX_TRANSACT_COMPOSE_ITEMS, a0 as Manifest, as as ManifestEntity, at as ManifestField, au as ManifestFieldType, av as ManifestGsi, aw as ManifestKey, ax as ManifestRelation, ay as ManifestTable, az as OperationSpec, _ as OperationsDocument, L as ParamSpec, aA as QueryContractMethodSpec, G as QuerySpec, aB as RangeConditionSpec, aC as ReadOperationType, K as SPEC_VERSION, aD as TransactionItemSpec, aE as TransactionItemType, I as TransactionSpec, aF as WhenSpec, aG as WriteOperationType, aH as assertNoCrossFragmentMaintainCollision, aI as compileFragment, aJ as compileMutationPlan, aK as compileSingleFragmentPlan, aL as resetMaintenanceGraphCache, aM as resolveLifecycle, aN as resolveMaintainers } from '../maintenance-view-adapter-C1HaBX4y.js';
2
- export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, b as ContextOwnershipMap, c as ContractBoundaryViolation, d as ContractInputs, e as ContractMap, f as ContractN1Violation, O as PREPARED_FORMAT_VERSION, Q as PreparedBindMap, g as PreparedBindSpec, a as PreparedPlanDocument, h as PreparedPlanSpec, i as PreparedReadRouteSpec, P as PreparedWriteOpSpec, s as assertBundleSerializable, t as assertContractBoundaries, u as assertContractN1Safe, v as assertJsonSerializable, w as assertSupportedCondition, x as buildBridgeBundle, y as buildContexts, z as buildContracts, D as buildManifest, E as buildOperations, R as buildPreparedPlanDocument, F as buildQuerySpec, G as buildTransactionSpec, H as buildTransactions, S as canonicalJson, I as collectContractBoundaryViolations, J as collectContractN1Violations, U as compilePreparedPlan, V as entityFingerprint, X as planFingerprint } from '../index-BnTZQ_IG.js';
3
- import '../registry-DWhq5wiA.js';
1
+ export { a1 as BridgeBundle, a4 as CommandContractMethodSpec, a5 as CommandResolutionTarget, H as CommandSpec, a6 as CompiledFragment, a7 as CompiledMutationPlan, a8 as ComposeSpec, a9 as CompositionPlanSpec, a2 as ConditionSpec, J as ContextSpec, aa as ContractCardinality, ab as ContractCommandResult, ac as ContractInputArity, ad as ContractKeySpec, ae as ContractKind, af as ContractResolution, A as ContractSpec, ag as DerivedConditionCheck, ah as DerivedEdgeWrite, ai as DerivedIdempotencyGuard, aj as DerivedMaintainOutbox, ak as DerivedMaintainWrite, al as DerivedOutboxEvent, am as DerivedUniqueGuard, an as DerivedUpdate, ao as EntityRefResolver, ap as ExecutionPlanSpec, aq as FilterSpec, ar as MAX_TRANSACT_COMPOSE_ITEMS, a0 as Manifest, as as ManifestEntity, at as ManifestField, au as ManifestFieldType, av as ManifestGsi, aw as ManifestKey, ax as ManifestRelation, ay as ManifestTable, az as OperationSpec, _ as OperationsDocument, L as ParamSpec, aA as QueryContractMethodSpec, G as QuerySpec, aB as RangeConditionSpec, aC as ReadOperationType, K as SPEC_VERSION, aD as TransactionItemSpec, aE as TransactionItemType, I as TransactionSpec, aF as WhenSpec, aG as WriteOperationType, aH as assertNoCrossFragmentMaintainCollision, aI as compileFragment, aJ as compileMutationPlan, aK as compileSingleFragmentPlan, aL as resetMaintenanceGraphCache, aM as resolveLifecycle, aN as resolveMaintainers } from '../maintenance-view-adapter-BATUh_I8.js';
2
+ export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, b as ContextOwnershipMap, c as ContractBoundaryViolation, d as ContractInputs, e as ContractMap, f as ContractN1Violation, O as PREPARED_FORMAT_VERSION, Q as PreparedBindMap, g as PreparedBindSpec, a as PreparedPlanDocument, h as PreparedPlanSpec, i as PreparedReadRouteSpec, P as PreparedWriteOpSpec, s as assertBundleSerializable, t as assertContractBoundaries, u as assertContractN1Safe, v as assertJsonSerializable, w as assertSupportedCondition, x as buildBridgeBundle, y as buildContexts, z as buildContracts, D as buildManifest, E as buildOperations, R as buildPreparedPlanDocument, F as buildQuerySpec, G as buildTransactionSpec, H as buildTransactions, S as canonicalJson, I as collectContractBoundaryViolations, J as collectContractN1Violations, U as compilePreparedPlan, V as entityFingerprint, X as planFingerprint } from '../index-CtPJSMrc.js';
3
+ import '../registry-CXhP4TaE.js';
4
4
  import '@aws-sdk/client-dynamodb';
@@ -29,8 +29,8 @@ import {
29
29
  resetMaintenanceGraphCache,
30
30
  resolveLifecycle,
31
31
  resolveMaintainers
32
- } from "../chunk-WPABX7WG.js";
33
- import "../chunk-F2DI3GTI.js";
32
+ } from "../chunk-NYM7K2ST.js";
33
+ import "../chunk-PFFPLD4B.js";
34
34
  import "../chunk-PDUVTYC5.js";
35
35
  export {
36
36
  MAX_TRANSACT_COMPOSE_ITEMS,
@@ -1,4 +1,4 @@
1
- import { n as Executor, D as DynamoDBOperation, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, w as DDBModel, c as ChangeEvent } from '../maintenance-view-adapter-C1HaBX4y.js';
1
+ import { n as Executor, D as DynamoDBOperation, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, w as DDBModel, c as ChangeEvent } from '../maintenance-view-adapter-BATUh_I8.js';
2
2
  import '@aws-sdk/client-dynamodb';
3
3
 
4
4
  /**
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createCdcEmulator
3
- } from "../chunk-5NXNEW43.js";
3
+ } from "../chunk-ZPNRLOKA.js";
4
4
  import {
5
5
  ClientManager,
6
6
  MetadataRegistry,
7
7
  resolveModelClass
8
- } from "../chunk-F2DI3GTI.js";
8
+ } from "../chunk-PFFPLD4B.js";
9
9
  import {
10
10
  TableMapping
11
11
  } from "../chunk-PDUVTYC5.js";