@dbsp/types 3.4.0 → 5.0.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { bV as RecursiveTraversal, e as AdjacencyTraversal, c_ as WindowFunction, l as AggregateWindowFunction, bb as OffsetWindowFunction, ak as ExpressionIntent, F as CoalesceExpressionIntent, G as ColumnAliasIntent, a0 as CustomTraversal, bB as QueryIntent, bP as RecursiveIntent, aW as MutationIntent, a7 as DeleteIntent, ag as EdgeTableTraversal, aB as InsertIntent, bF as RankingWindowFunction, bI as RawExpressionIntent, bX as RelationColumnIntent, c8 as SelectIntent, c5 as SelectAggregateIntent, c6 as SelectAllIntent, c7 as SelectFieldsIntent, c9 as SelectWithExpressionsIntent, cm as SubqueryRefIntent, cz as UpdateIntent, cD as UpsertIntent, cN as WhereIntent, cF as WhereAndIntent, cG as WhereAnyIntent, cH as WhereComparisonIntent, cI as WhereExistsIntent, cK as WhereInIntent, cQ as WhereLikeIntent, cU as WhereOrIntent, cS as WhereNotIntent, cR as WhereNotExistsIntent, cT as WhereNullIntent, cV as WhereRangeIntent, cY as WhereRelationFilterIntent, cZ as WhereSubqueryIntent, c$ as WindowIntent, J as ColumnJsReadType, cp as TableIR, aV as ModelIR, K as ColumnListInput, bY as RelationIR, aq as ForeignKeyIR, cb as SemanticArtifactRef, cv as TrustRoot, be as OperationKindRef } from './adapter-CjwnHeg4.js';
2
- export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, H as ColumnExpressionIntent, I as ColumnIR, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as DDLGeneratingAdapter, a5 as DbCasing, a6 as DecisionType, a8 as DialectCapabilities, a9 as DialectName, aa as DiffSummary, ab as DropIndexOptions, ac as DuckDBColumnType, ad as Dump, ae as DumpMeta, af as DumpSequenceStep, ah as EmitJoinClause, ai as EnumIR, aj as ExecutingAdapter, al as FeatureBehaviorConfig, am as FeatureTranslator, an as FeatureWarning, ao as FieldRef, ap as FilterStrategy, ar as FunctionExpressionIntent, as as HierarchyIR, at as IncludeIntent, au as IncludeRecursiveOptions, av as IncludeStrategy, aw as IndexColumnDef, ax as IndexIR, ay as IndexInfo, az as IndexMethod, aA as InsertFromIntent, aC as IntrospectingAdapter, aD as IntrospectionOptions, aE as IntrospectionResult, aF as IsTypeSupported, aG as JoinDefault, aH as JoinIntent, aI as JsonAggOrderByEntry, aJ as JsonContainsIntent, aK as JsonExistsIntent, aL as JsonExtractIntent, aM as JsonPathExtractIntent, aN as LiteralExpressionIntent, aO as LockIntent, aP as LockStrength, aQ as LockWaitPolicy, aR as LogicalIdentity, aS as LogicalIdentityCarrier, aT as LogicalOperator, aU as MSSQLColumnType, aX as MutationReturningItem, aY as MySQLColumnType, aZ as NamedArgExpressionIntent, a_ as NestedOutputReadHandling, a$ as NqlBindingColumnLineage, b0 as NqlBindingColumnTypeInfo, b1 as NqlBindingColumnUntypeableReason, b2 as NqlBindingOutputSchema, b3 as NqlBindingRelationFilterMetadata, N as NqlBindingRelationType, b4 as NqlBindingVirtualRelation, b5 as NqlBindingVirtualRelationHop, b6 as NqlBindingVirtualRelationRecursive, b7 as NqlProgramSequenceStep, b8 as NqlRuntimeBinding, b9 as NullOperator, ba as NullsPosition, bc as OffsetWindowIntent, bd as OnDeleteAction, bf as Optionality, bg as OrderByExpressionIntent, bh as OrderByFieldIntent, bi as OrderByIntent, bj as OutputDescriptor, bk as OutputReadHandling, bl as OutputSource, bm as OutputValueShape, bn as ParamExpressionIntent, bo as ParamIntent, bp as PartitionIR, bq as PinnedConnectionOptions, br as PlanDecision, bs as PlanOptions, P as PlanReport, bt as PlanWarning, bu as PlanWarningCode, bv as PolicyIR, bw as PostgresColumnType, bx as PostgresOnlyColumnType, by as PseudoColumnExpressionIntent, bz as PseudoColumnMetadata, bA as PseudoColumnTraversal, bC as RangeOperand, bD as RangeOperator, bE as RangeValue, bG as RankingWindowIntent, bH as RawCteIntent, bJ as RawSqlAdapter, bK as RecursiveAdvancedOptions, bL as RecursiveDedupe, bM as RecursiveDirection, bN as RecursiveEmitOptions, bO as RecursiveExistsOptions, bQ as RecursiveMetadata, bR as RecursiveNodeIdExpr, bS as RecursivePlanOptions, bT as RecursivePlanReport, bU as RecursiveTrackOptions, bW as RefExpressionIntent, bZ as RelationKind, b_ as RelationOperator, b$ as RelationType, c0 as RequiredEnumLabelIR, c1 as ResolvedIncludeStrategy, c2 as SQLiteColumnType, c3 as SchemaChange, c4 as SchemaDiff, ca as SemanticArtifactId, cc as SequenceIR, cd as SetOperationIntent, ce as SetOperationType, cf as SimpleCteIntent, cg as SortDirection, ch as StarExpressionIntent, ci as StreamingAdapter, cj as StringOperator, ck as SubqueryExpressionIntent, cl as SubqueryIncludeInfo, cn as SupportedColumnTypes, co as TableDDLGeneratorAdapter, cq as TransactionBeginOptions, cr as TransactionOptions, cs as TransactionalAdapter, ct as TranslationContext, cu as TruncateOptions, cw as UnaryExpressionIntent, cx as UnnestCteIntent, cy as UnsupportedFeatureBehavior, cA as UpsertConflictAction, cB as UpsertConflictTarget, cC as UpsertFromIntent, cE as VacuumOptions, cJ as WhereExpressionIntent, cL as WhereInSubqueryIntent, cM as WhereInValueIntent, cO as WhereJsonContainsIntent, cP as WhereJsonExistsIntent, cW as WhereRawExistsIntent, cX as WhereRawNotExistsIntent, d0 as WindowOrderBy, d1 as getNodeIdAlias, d2 as isFieldRef, d3 as isParamIntent, d4 as resolveOutputReadHandling, d5 as toColumnList } from './adapter-CjwnHeg4.js';
1
+ import { bV as RecursiveTraversal, e as AdjacencyTraversal, d1 as WindowFunction, l as AggregateWindowFunction, ba as OffsetWindowFunction, aj as ExpressionIntent, F as CoalesceExpressionIntent, G as ColumnAliasIntent, a0 as CustomTraversal, bB as QueryIntent, bP as RecursiveIntent, aV as MutationIntent, a6 as DeleteIntent, af as EdgeTableTraversal, aA as InsertIntent, bF as RankingWindowFunction, bI as RawExpressionIntent, bX as RelationColumnIntent, c8 as SelectIntent, c5 as SelectAggregateIntent, c6 as SelectAllIntent, c7 as SelectFieldsIntent, c9 as SelectWithExpressionsIntent, cn as SubqueryRefIntent, cC as UpdateIntent, cG as UpsertIntent, cQ as WhereIntent, cI as WhereAndIntent, cJ as WhereAnyIntent, cK as WhereComparisonIntent, cL as WhereExistsIntent, cN as WhereInIntent, cT as WhereLikeIntent, cX as WhereOrIntent, cV as WhereNotIntent, cU as WhereNotExistsIntent, cW as WhereNullIntent, cY as WhereRangeIntent, c$ as WhereRelationFilterIntent, d0 as WhereSubqueryIntent, d2 as WindowIntent, J as ColumnJsReadType, cq as TableIR, aU as ModelIR, K as ColumnListInput, bY as RelationIR, ap as ForeignKeyIR, cb as SemanticArtifactRef, cy as TrustRoot, bd as OperationKindRef, cc as SequenceIR, cs as TableReaddressDeclaration } from './adapter-DXjfHEAf.js';
2
+ export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, H as ColumnExpressionIntent, I as ColumnIR, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as DbCasing, a5 as DecisionType, a7 as DialectCapabilities, a8 as DialectName, a9 as DiffSummary, aa as DropIndexOptions, ab as DuckDBColumnType, ac as Dump, ad as DumpMeta, ae as DumpSequenceStep, ag as EmitJoinClause, ah as EnumIR, ai as ExecutingAdapter, ak as FeatureBehaviorConfig, al as FeatureTranslator, am as FeatureWarning, an as FieldRef, ao as FilterStrategy, aq as FunctionExpressionIntent, ar as HierarchyIR, as as IncludeIntent, at as IncludeRecursiveOptions, au as IncludeStrategy, av as IndexColumnDef, aw as IndexIR, ax as IndexInfo, ay as IndexMethod, az as InsertFromIntent, aB as IntrospectingAdapter, aC as IntrospectionOptions, aD as IntrospectionResult, aE as IsTypeSupported, aF as JoinDefault, aG as JoinIntent, aH as JsonAggOrderByEntry, aI as JsonContainsIntent, aJ as JsonExistsIntent, aK as JsonExtractIntent, aL as JsonPathExtractIntent, aM as LiteralExpressionIntent, aN as LockIntent, aO as LockStrength, aP as LockWaitPolicy, aQ as LogicalIdentity, aR as LogicalIdentityCarrier, aS as LogicalOperator, aT as MSSQLColumnType, aW as MutationReturningItem, aX as MySQLColumnType, aY as NamedArgExpressionIntent, aZ as NestedOutputReadHandling, a_ as NqlBindingColumnLineage, a$ as NqlBindingColumnTypeInfo, b0 as NqlBindingColumnUntypeableReason, b1 as NqlBindingOutputSchema, b2 as NqlBindingRelationFilterMetadata, N as NqlBindingRelationType, b3 as NqlBindingVirtualRelation, b4 as NqlBindingVirtualRelationHop, b5 as NqlBindingVirtualRelationRecursive, b6 as NqlProgramSequenceStep, b7 as NqlRuntimeBinding, b8 as NullOperator, b9 as NullsPosition, bb as OffsetWindowIntent, bc as OnDeleteAction, be as Optionality, bf as OrderByExpressionIntent, bg as OrderByFieldIntent, bh as OrderByIntent, bi as OutputDescriptor, bj as OutputReadHandling, bk as OutputSource, bl as OutputValueShape, bm as ParamExpressionIntent, bn as ParamIntent, bo as PartitionIR, bp as PinnedConnectionOptions, bq as PlanDecision, br as PlanOptions, P as PlanReport, bs as PlanWarning, bt as PlanWarningCode, bu as PolicyIR, bv as PostgresColumnType, bw as PostgresOnlyColumnType, bx as PredicateOperator, by as PseudoColumnExpressionIntent, bz as PseudoColumnMetadata, bA as PseudoColumnTraversal, bC as RangeOperand, bD as RangeOperator, bE as RangeValue, bG as RankingWindowIntent, bH as RawCteIntent, bJ as RawSqlAdapter, bK as RecursiveAdvancedOptions, bL as RecursiveDedupe, bM as RecursiveDirection, bN as RecursiveEmitOptions, bO as RecursiveExistsOptions, bQ as RecursiveMetadata, bR as RecursiveNodeIdExpr, bS as RecursivePlanOptions, bT as RecursivePlanReport, bU as RecursiveTrackOptions, bW as RefExpressionIntent, bZ as RelationKind, b_ as RelationOperator, b$ as RelationType, c0 as RequiredEnumLabelIR, c1 as ResolvedIncludeStrategy, c2 as SQLiteColumnType, c3 as SchemaChange, c4 as SchemaDiff, ca as SemanticArtifactId, cd as SetOperationIntent, ce as SetOperationType, cf as SimpleCteIntent, cg as SortDirection, ch as StandaloneWhereExpressionIntent, ci as StarExpressionIntent, cj as StreamingAdapter, ck as StringOperator, cl as SubqueryExpressionIntent, cm as SubqueryIncludeInfo, co as SupportedColumnTypes, cp as TableDDLGeneratorAdapter, cr as TableReaddressAddress, ct as TransactionBeginOptions, cu as TransactionOptions, cv as TransactionalAdapter, cw as TranslationContext, cx as TruncateOptions, cz as UnaryExpressionIntent, cA as UnnestCteIntent, cB as UnsupportedFeatureBehavior, cD as UpsertConflictAction, cE as UpsertConflictTarget, cF as UpsertFromIntent, cH as VacuumOptions, cM as WhereExpressionIntent, cO as WhereInSubqueryIntent, cP as WhereInValueIntent, cR as WhereJsonContainsIntent, cS as WhereJsonExistsIntent, cZ as WhereRawExistsIntent, c_ as WhereRawNotExistsIntent, d3 as WindowOrderBy, d4 as getNodeIdAlias, d5 as isFieldRef, d6 as isParamIntent, d7 as resolveOutputReadHandling, d8 as toColumnList } from './adapter-DXjfHEAf.js';
3
3
 
4
4
  /**
5
5
  * NQL-origin SELECT function allowlist.
@@ -203,6 +203,10 @@ declare function resolveJsonAggOrderKey(table: TableIR): JsonAggOrderKey;
203
203
  */
204
204
  interface LoadedSchema {
205
205
  readonly definition: Record<string, unknown>;
206
+ /** Retained schema() inputs used when per-object declarations are sliced. */
207
+ readonly constraints?: unknown;
208
+ readonly extras?: unknown;
209
+ readonly options?: unknown;
206
210
  readonly model: ModelIR;
207
211
  readonly tableNames: readonly string[];
208
212
  }
@@ -218,6 +222,46 @@ interface LoadedSchema {
218
222
  */
219
223
  declare function isValidSchema(schema: unknown): schema is LoadedSchema;
220
224
 
225
+ /** A dialect-neutral address of one declared or derived database name.
226
+ *
227
+ * `name` is always in the model's logical spelling. For derived objects it is
228
+ * the template result from logical parts (for example `pk_<table>`), rather
229
+ * than a database spelling.
230
+ */
231
+ type LogicalNameAddress = {
232
+ readonly kind: 'table' | 'enum' | 'sequence';
233
+ readonly schema: string;
234
+ readonly name: string;
235
+ } | {
236
+ readonly kind: 'column' | 'index' | 'constraint' | 'policy';
237
+ readonly schema: string;
238
+ readonly table: string;
239
+ readonly name: string;
240
+ };
241
+ interface PhysicalNameEntry {
242
+ readonly logical: LogicalNameAddress;
243
+ readonly physical: string;
244
+ /** Sequence entries distinguish authored declarations from serial/identity predictions. */
245
+ readonly sequenceProvenance?: 'declared' | 'generated';
246
+ }
247
+ declare class PhysicalNameInventoryDuplicateError extends Error {
248
+ readonly scope: 'logical-address' | 'table' | 'column';
249
+ readonly first: PhysicalNameEntry;
250
+ readonly second: PhysicalNameEntry;
251
+ constructor(scope: 'logical-address' | 'table' | 'column', first: PhysicalNameEntry, second: PhysicalNameEntry);
252
+ }
253
+ interface PhysicalNameInventory {
254
+ readonly entries: readonly PhysicalNameEntry[];
255
+ has(address: LogicalNameAddress): boolean;
256
+ get(address: LogicalNameAddress): string;
257
+ }
258
+ /** Creates an immutable, canonical logical-address-to-physical-name inventory. */
259
+ declare function createPhysicalNameInventory(entries: readonly PhysicalNameEntry[]): PhysicalNameInventory;
260
+ declare class PhysicalNameInventoryMissingError extends Error {
261
+ readonly address: LogicalNameAddress;
262
+ constructor(address: LogicalNameAddress);
263
+ }
264
+
221
265
  type RelationKeyDirection = 'belongsTo' | 'inverse';
222
266
  type RelationKeyForeignKey = Pick<ForeignKeyIR, 'references'> & {
223
267
  readonly columns: ColumnListInput;
@@ -252,18 +296,46 @@ interface FingerprintManifest {
252
296
  readonly digest: string;
253
297
  }
254
298
 
255
- type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
299
+ type JsonObject = {
256
300
  readonly [k: string]: JsonValue;
257
301
  };
302
+ type JsonValue = null | boolean | number | string | readonly JsonValue[] | JsonObject;
258
303
 
304
+ /** The managed catalogue kinds. This union is intentionally closed. */
305
+ type DeclarableKind = 'table' | 'column' | 'index' | 'constraint' | 'enum' | 'sequence' | 'extension';
306
+ /** Adapter-owned, versioned durable catalogue identity. */
307
+ interface CatalogueIdentity {
308
+ readonly engine: string;
309
+ readonly format: number;
310
+ readonly value: JsonObject;
311
+ }
312
+ /**
313
+ * The durable PostgreSQL role identity which controls a managed ledger entry.
314
+ * A role name alone is reusable after DROP/CREATE; the OID binds the record to
315
+ * the role that was actually present when the event was written.
316
+ */
317
+ interface ControllerIdentity {
318
+ readonly name: string;
319
+ readonly oid: string;
320
+ }
321
+ /** Compare the complete durable controller identity in one place. */
322
+ declare function sameControllerIdentity(recorded: ControllerIdentity, current: ControllerIdentity): boolean;
259
323
  interface ResourceAddress {
260
324
  readonly engine: string;
261
325
  readonly database: string;
262
326
  readonly schema?: string;
327
+ /** The containing object, for example an index or column's table. */
328
+ readonly parent?: ResourceAddress;
263
329
  readonly kind: string;
264
330
  readonly name: string;
331
+ /** Recorded catalogue identity. It is absent only for legacy/non-managed scope. */
332
+ readonly catalogueIdentity?: CatalogueIdentity;
265
333
  readonly qualifiedBy?: readonly string[];
266
334
  }
335
+ /** A managed declaration cannot spell a kind outside the declarable set. */
336
+ type DeclarableResourceAddress<K extends DeclarableKind = DeclarableKind> = Omit<ResourceAddress, 'kind'> & {
337
+ readonly kind: K;
338
+ };
267
339
  interface ResourceSelector {
268
340
  readonly kind?: string;
269
341
  readonly schema?: string;
@@ -369,7 +441,7 @@ interface ProofObligation {
369
441
  }
370
442
  interface Assumption {
371
443
  readonly id: AssumptionId;
372
- readonly class: 'rule-effect-declaration' | 'user-blast-radius' | 'external-ddl-exclusion' | 'operation-pack-semantics' | 'baseline-identity-attachment' | (string & {});
444
+ readonly class: 'rule-effect-declaration' | 'user-blast-radius' | 'external-ddl-exclusion' | 'operation-pack-semantics' | 'baseline-identity-attachment' | 'non-transactional-segment' | (string & {});
373
445
  readonly asserter: TrustRoot;
374
446
  readonly statement: string;
375
447
  readonly scope: readonly ResourceAddress[];
@@ -491,6 +563,13 @@ interface ExternalEffectCoverage {
491
563
  }
492
564
  type OperationExecutionOutcome = {
493
565
  readonly kind: 'completed';
566
+ } | {
567
+ readonly kind: 'recovery-required';
568
+ readonly claimId: string;
569
+ readonly detail: string;
570
+ } | {
571
+ readonly kind: 'transport-ambiguous';
572
+ readonly detail: string;
494
573
  } | {
495
574
  readonly kind: 'guard-failed';
496
575
  readonly guard: ApplyGuard;
@@ -655,6 +734,43 @@ type InapplicableAssessment = PlanAssessment & {
655
734
  readonly decision: 'inapplicable';
656
735
  };
657
736
 
737
+ interface AssumptionAcceptance {
738
+ readonly class: string;
739
+ readonly fromTrustRoot?: TrustRoot;
740
+ readonly withinScope?: readonly ResourceSelector[];
741
+ }
742
+ interface ApplyPolicy {
743
+ readonly accepts: readonly AssumptionAcceptance[];
744
+ }
745
+ /**
746
+ * The scoped approvals carried into admitted execution. This distinct input
747
+ * prevents execution boundaries from silently degrading reviewed scope to a
748
+ * bare list of approval-class strings.
749
+ */
750
+ interface ScopedApprovalSet {
751
+ readonly approvals: readonly AssumptionAcceptance[];
752
+ /** The authority root declared for this admitted policy evaluation. */
753
+ readonly declaredTrustRoot?: TrustRoot;
754
+ }
755
+
756
+ /**
757
+ * The closed set of durable declarative fragments. Consumers receive this
758
+ * type rather than a stringly kind so an undeclarable surface is impossible to
759
+ * express without extending the one union above.
760
+ */
761
+ interface ManagedDeclaration<K extends DeclarableKind = DeclarableKind> {
762
+ readonly address: DeclarableResourceAddress<K>;
763
+ readonly fragment: JsonValue;
764
+ /** SHA-256 of the canonical parsed fragment, never of storage bytes. */
765
+ readonly digest: string;
766
+ }
767
+ interface DeclarationSet {
768
+ readonly version: 1;
769
+ readonly declarations: readonly ManagedDeclaration[];
770
+ /** SHA-256 of the canonical parsed declaration set. */
771
+ readonly digest: string;
772
+ }
773
+
658
774
  /**
659
775
  * Durable, reviewed conditions for executing a serialized transition plan.
660
776
  *
@@ -704,24 +820,578 @@ interface ExecutionContract {
704
820
  readonly requirements: readonly ExecutionRequirement[];
705
821
  }
706
822
 
823
+ /** The unit-9/SC-64 vocabulary is the one source for durable refusal prose. */
824
+ declare const REFUSAL_VOCABULARY: {
825
+ readonly 'ERR-01': {
826
+ readonly cause: "unaccepted non-transactional segment";
827
+ readonly withheldAuthority: "non-transactional execution authority";
828
+ readonly resolvingCommand: "dbsp apply";
829
+ };
830
+ readonly 'ERR-02': {
831
+ readonly cause: "pre-existing object has no admitted adoption";
832
+ readonly withheldAuthority: "creation authority over an occupied address";
833
+ readonly resolvingCommand: "dbsp apply";
834
+ };
835
+ readonly 'ERR-03': {
836
+ readonly cause: "managed-ledger preflight is not current";
837
+ readonly withheldAuthority: "managed-ledger mutation authority";
838
+ readonly resolvingCommand: "dbsp preflight --reinitialize";
839
+ };
840
+ readonly 'ERR-04': {
841
+ readonly cause: "removal containment cannot be proven";
842
+ readonly withheldAuthority: "destructive removal authority";
843
+ readonly resolvingCommand: "dbsp apply";
844
+ };
845
+ readonly 'ERR-05': {
846
+ readonly cause: "recorded identity differs from the live object";
847
+ readonly withheldAuthority: "managed mutation authority";
848
+ readonly resolvingCommand: "dbsp apply";
849
+ };
850
+ readonly 'ERR-06': {
851
+ readonly cause: "managed-ledger lineage does not match this target";
852
+ readonly withheldAuthority: "managed-ledger mutation authority";
853
+ readonly resolvingCommand: "dbsp preflight --reinitialize";
854
+ };
855
+ readonly 'ERR-07': {
856
+ readonly cause: "target database is read-only";
857
+ readonly withheldAuthority: "database write authority";
858
+ readonly resolvingCommand: "dbsp apply";
859
+ };
860
+ readonly 'ERR-08': {
861
+ readonly cause: "ledger chain is malformed";
862
+ readonly withheldAuthority: "managed mutation authority";
863
+ readonly resolvingCommand: "dbsp inspect";
864
+ };
865
+ readonly 'ERR-09': {
866
+ readonly cause: "catalogue read is unavailable";
867
+ readonly withheldAuthority: "outcome classification authority";
868
+ readonly resolvingCommand: "dbsp reconcile";
869
+ };
870
+ readonly 'ERR-10': {
871
+ readonly cause: "recorded-plan path cannot execute a removal";
872
+ readonly withheldAuthority: "recorded-plan removal execution";
873
+ readonly resolvingCommand: "dbsp apply";
874
+ };
875
+ readonly 'ERR-11': {
876
+ readonly cause: "recovery proved the interrupted operation had no effect";
877
+ readonly withheldAuthority: "recovery execution authority";
878
+ readonly resolvingCommand: "dbsp reconcile";
879
+ };
880
+ };
881
+ type RefusalCode = keyof typeof REFUSAL_VOCABULARY;
882
+ /** Bind a catalogue entry to the address state that existed at refusal time. */
883
+ declare function refusalFor(code: RefusalCode, input: Pick<LedgerRefusal, 'state'> & {
884
+ readonly address?: LedgerAddress;
885
+ }): LedgerRefusal;
886
+
887
+ /** The outcome protocol is closed at the fourteen ADR 0006 event kinds. */
888
+ declare const LEDGER_EVENT_KINDS: readonly ["adopt-intent", "adopt", "intent", "retire-intent", "readdress-intent", "refused", "executing", "observed", "absent", "indeterminate", "resolved", "readdressed-to", "readdressed-from", "released"];
889
+ type LedgerEventKind = (typeof LEDGER_EVENT_KINDS)[number];
890
+ type LedgerClaimKind = Extract<LedgerEventKind, 'adopt-intent' | 'intent' | 'retire-intent' | 'readdress-intent'>;
707
891
  /**
708
- * ProvenPlanShape is the serializable audit/dump shape of a plan the prover can
709
- * derive. It is not an apply credential: runtime safety comes from @dbsp/core
710
- * apply() accepting only an InProcessProvenPlan minted by this module instance's
711
- * prove() through a module-private WeakSet identity capability plus deep-freeze.
712
- *
713
- * A serialized, cloned, or hand-forged shape is not authorized for apply(). A
714
- * separate future adoptSerializedPlan(serialized, observationContext) API
715
- * (stage: identity & adoption) will re-derive an in-process plan from fresh
716
- * observations; apply() must not be overloaded to accept serialized data.
892
+ * A canonical address is recorded as columns by PostgreSQL and as this shape at
893
+ * the adapter boundary. `scope` selects exactly one physical ledger.
894
+ */
895
+ interface LedgerAddress extends ResourceAddress {
896
+ readonly scope: 'schema' | 'database';
897
+ }
898
+ /**
899
+ * Construct the one parent shape used by ledger-bearing child addresses.
717
900
  *
718
- * The derived plan shape is expected to satisfy these relational invariants,
719
- * which are beyond structural typing:
720
- * - Every ApplyGuard.appliesTo and ProofObligation.appliesTo matches exactly one PhysicalOperation.ref in the same step/fragment (no dangling or duplicate ref).
721
- * - Every external-ddl-exclusion binding's AssumptionId is present in the step's restsOnAssumptions closure and in GuardedPlan.assumptions.
722
- * - Journal record stepIds are consistent with intent.stepId; ApplyResult.observations is a superset of every ObservedOutcomeRecord.observations.
901
+ * A parent identifies containment only. Ledger scope belongs to the child
902
+ * address, while a catalogue identity is an observed, non-address fact. Keep
903
+ * both out of this recursive serialization so every producer names a physical
904
+ * child the same way.
905
+ */
906
+ declare function canonicalResourceParent(address: ResourceAddress): ResourceAddress;
907
+ /**
908
+ * The sole structural equality for a ledger address. Parent absence is
909
+ * canonicalized so `undefined` and `null` mean the same root address.
910
+ */
911
+ declare function sameLedgerAddress(left: LedgerAddress, right: LedgerAddress): boolean;
912
+ /** A canonical map key with the same key-order-insensitive parent semantics. */
913
+ declare function ledgerAddressKey(address: LedgerAddress): string;
914
+ /**
915
+ * Canonical parent representation for PostgreSQL's `address_parent` column.
916
+ * Catalogue observations never create another physical ledger address.
917
+ */
918
+ declare function ledgerAddressParentJson(address: LedgerAddress): string;
919
+ interface LedgerPayload {
920
+ readonly value: JsonValue;
921
+ readonly digest: string;
922
+ }
923
+ /**
924
+ * The durable, operator-facing explanation attached to a `refused` terminal.
925
+ * The address itself remains in the event's canonical address columns; these
926
+ * values preserve the other facts needed to explain a historic refusal.
927
+ */
928
+ interface LedgerRefusal {
929
+ /** Closed durable vocabulary; stored strings are validated at the reader. */
930
+ readonly code: RefusalCode;
931
+ readonly cause: string;
932
+ readonly state: 'unknown' | 'managed' | 'absent';
933
+ readonly withheldAuthority: string;
934
+ readonly resolvingCommand: string;
935
+ }
936
+ interface LedgerChainMember {
937
+ readonly eventId: string;
938
+ readonly executionId?: string;
939
+ readonly plannedClaimKey?: string;
940
+ readonly claimGroupId?: string;
941
+ readonly rootClaimId?: string;
942
+ readonly address: LedgerAddress;
943
+ readonly catalogueIdentity?: CatalogueIdentity;
944
+ readonly eventKind: LedgerEventKind;
945
+ readonly predecessor?: string;
946
+ readonly pairId?: string;
947
+ readonly declared?: LedgerPayload;
948
+ readonly observed?: LedgerPayload;
949
+ /** Present exactly on a durable `refused` terminal. */
950
+ readonly refusal?: LedgerRefusal;
951
+ readonly controller: string;
952
+ /** The durable OID paired with `controller` when the event was recorded. */
953
+ readonly controllerOid?: string;
954
+ readonly recordedAt?: string;
955
+ }
956
+ /** A durable effects-closure reservation, anchored in its root claim's ledger. */
957
+ interface LedgerReservationRow {
958
+ readonly address: LedgerAddress;
959
+ readonly claimKind: LedgerClaimKind;
960
+ readonly executionId: string;
961
+ readonly pairId?: string;
962
+ readonly rootClaimId: string;
963
+ readonly homeLedger: LedgerHome;
964
+ }
965
+ interface LedgerHome {
966
+ readonly scope: 'schema' | 'database';
967
+ /** Present exactly for a schema ledger. */
968
+ readonly schema?: string;
969
+ }
970
+ /** The lineage facts stored beside every ledger; their admission rules ship later. */
971
+ interface LedgerIdentity {
972
+ readonly clusterSystemIdentifier: string;
973
+ readonly databaseOid: string;
974
+ readonly namespaceOid?: string;
975
+ }
976
+ interface LedgerShapeMarker {
977
+ readonly version: number;
978
+ }
979
+ /**
980
+ * The only marker vocabulary understood by the reinitialize-preflight path.
981
+ * `absent` is deliberately distinct from a malformed or old marker: a
982
+ * missing marker is how a new scope enters the cutover.
983
+ */
984
+ type LedgerMarkerState = {
985
+ readonly kind: 'current';
986
+ } | {
987
+ readonly kind: 'absent';
988
+ } | {
989
+ readonly kind: 'older';
990
+ readonly version: number;
991
+ } | {
992
+ readonly kind: 'future';
993
+ readonly version: number;
994
+ } | {
995
+ readonly kind: 'mixed';
996
+ readonly versions: readonly number[];
997
+ } | {
998
+ readonly kind: 'unreadable';
999
+ readonly reason: string;
1000
+ };
1001
+ /** The closed result set for one explicit reinitialize-preflight scope. */
1002
+ type ReinitializePreflightScopeOutcome = 'current' | 'unchanged' | 'failed' | 'not-attempted';
1003
+ type ReinitializePreflightRefusalCode = 'database-read-only' | 'reinitialize-preflight-marker-not-current' | 'reinitialize-preflight-advisory-lock' | 'reinitialize-preflight-ownership' | 'reinitialize-preflight-grants' | 'reinitialize-preflight-lineage' | 'reinitialize-preflight-failed';
1004
+ /** The exact operation that produced a reported preflight failure. */
1005
+ type ReinitializePreflightFailureStep = 'advisory-lock' | 'marker' | 'identity' | 'ownership-grants' | 'archive' | 'create' | 'record-identity' | 'creation-grants' | 'write-marker' | 'output';
1006
+ /** PostgreSQL's unmodified message, paired with the engine step that failed. */
1007
+ interface ReinitializePreflightFailureReason {
1008
+ readonly step: ReinitializePreflightFailureStep;
1009
+ readonly message: string;
1010
+ }
1011
+ interface ReinitializePreflightScopeReportBase {
1012
+ readonly ledger: LedgerHome;
1013
+ readonly marker: LedgerMarkerState;
1014
+ readonly refusal?: {
1015
+ readonly code: ReinitializePreflightRefusalCode;
1016
+ readonly detail: string;
1017
+ };
1018
+ }
1019
+ /** A failed scope is structurally required to retain its diagnostic. */
1020
+ type ReinitializePreflightScopeReport = (ReinitializePreflightScopeReportBase & {
1021
+ readonly outcome: 'failed';
1022
+ readonly reason: ReinitializePreflightFailureReason;
1023
+ }) | (ReinitializePreflightScopeReportBase & {
1024
+ readonly outcome: Exclude<ReinitializePreflightScopeOutcome, 'failed'>;
1025
+ readonly reason?: never;
1026
+ });
1027
+ /** A current DSL declaration for which no chain exists in its home ledger. */
1028
+ interface ReinitializePreflightAdoptionCandidate {
1029
+ readonly address: LedgerAddress;
1030
+ readonly declaration: LedgerPayload;
1031
+ }
1032
+ interface ReinitializePreflightReport {
1033
+ readonly scopes: readonly ReinitializePreflightScopeReport[];
1034
+ readonly adoptionCandidates: readonly ReinitializePreflightAdoptionCandidate[];
1035
+ }
1036
+
1037
+ /** The only durable management states an address can have. */
1038
+ type LedgerStableState = 'unknown' | 'managed' | 'absent';
1039
+ /** A claim is open until its own grammar column closes it. */
1040
+ interface LedgerOpenClaim {
1041
+ readonly event: LedgerChainMember;
1042
+ readonly kind: LedgerClaimKind;
1043
+ readonly stableStateBeforeClaim: LedgerStableState;
1044
+ readonly phase: 'claimed' | 'executing' | 'indeterminate';
1045
+ }
1046
+ /** What readers present: stable state plus any still-open claim. */
1047
+ type LedgerReportedState = {
1048
+ readonly kind: LedgerStableState;
1049
+ } | {
1050
+ readonly kind: 'pending';
1051
+ readonly stableState: LedgerStableState;
1052
+ readonly claim: LedgerOpenClaim;
1053
+ } | {
1054
+ readonly kind: 'blocked';
1055
+ readonly stableState: LedgerStableState;
1056
+ readonly claim: LedgerOpenClaim;
1057
+ };
1058
+ /** The legal lifecycle grammar is deliberately a closed, per-claim matrix. */
1059
+ interface LedgerLifecycleGrammarColumn {
1060
+ readonly claimKind: LedgerClaimKind;
1061
+ readonly opensFrom: readonly LedgerStableState[];
1062
+ readonly resolvesThrough: readonly LedgerEventKind[];
1063
+ }
1064
+ interface ProjectedLedgerChain {
1065
+ readonly kind: 'projected-ledger-chain';
1066
+ readonly ledger: LedgerHome;
1067
+ readonly address: LedgerAddress;
1068
+ readonly events: readonly LedgerChainMember[];
1069
+ readonly stableState: LedgerStableState;
1070
+ readonly openClaim?: LedgerOpenClaim;
1071
+ readonly reportedState: LedgerReportedState;
1072
+ /** The last declaration fact recorded by a claim chain, if any. */
1073
+ readonly declaration?: LedgerPayload;
1074
+ /** The last read-back recorded by a claim chain, if any. */
1075
+ readonly observation?: LedgerPayload;
1076
+ }
1077
+ type UnprojectableChainReason = {
1078
+ readonly code: 'cycle';
1079
+ readonly eventIds: readonly string[];
1080
+ } | {
1081
+ readonly code: 'missing-predecessor';
1082
+ readonly eventId: string;
1083
+ readonly predecessor: string;
1084
+ } | {
1085
+ readonly code: 'fork';
1086
+ readonly predecessor?: string;
1087
+ readonly eventIds: readonly string[];
1088
+ } | {
1089
+ readonly code: 'unknown-event-kind';
1090
+ readonly eventId: string;
1091
+ readonly eventKind: string;
1092
+ } | {
1093
+ readonly code: 'address-mismatch';
1094
+ readonly eventId: string;
1095
+ } | {
1096
+ readonly code: 'duplicate-event-id';
1097
+ readonly eventId: string;
1098
+ } | {
1099
+ readonly code: 'invalid-lifecycle-edge';
1100
+ readonly eventId: string;
1101
+ readonly detail: string;
1102
+ };
1103
+ /**
1104
+ * A degraded read is data, not an exception. Its required reason lets every
1105
+ * mutation fail closed while inspect-like readers can still display the chain.
723
1106
  */
1107
+ interface UnprojectableLedgerChain {
1108
+ readonly kind: 'unprojectable-ledger-chain';
1109
+ readonly ledger: LedgerHome;
1110
+ readonly address: LedgerAddress;
1111
+ readonly events: readonly LedgerChainMember[];
1112
+ readonly reason: UnprojectableChainReason;
1113
+ readonly codeVersion: 1;
1114
+ }
1115
+ type LedgerChainProjection = ProjectedLedgerChain | UnprojectableLedgerChain;
724
1116
 
1117
+ /** A planned managed statement has a stable position inside its claim bundle. */
1118
+ interface ClaimBundleStatement {
1119
+ readonly ordinal: number;
1120
+ readonly sql: string;
1121
+ }
1122
+ /**
1123
+ * The complete ordered set of statements a claim may execute. It is supplied
1124
+ * by planning and never extended by the execution path.
1125
+ */
1126
+ interface ClaimStatementBundle {
1127
+ readonly statements: readonly ClaimBundleStatement[];
1128
+ }
1129
+ /** A cascade-covered claim records a member fact but never executes SQL. */
1130
+ interface EmptyClaimStatementBundle {
1131
+ readonly statements: readonly [];
1132
+ }
1133
+ /**
1134
+ * Opaque capability minted only by the core claim-admission boundary.
1135
+ * Its members are intentionally not public: adapters present it to core rather
1136
+ * than reconstructing a claim identity from data controlled by a caller.
1137
+ */
1138
+ declare const claimTokenBrand: unique symbol;
1139
+ interface ClaimToken {
1140
+ readonly [claimTokenBrand]: 'dbsp-outcome-claim-token';
1141
+ }
1142
+ /**
1143
+ * Opaque execution authority minted only after an adapter has admitted a live
1144
+ * operation. It deliberately has no structural fields a caller can supply.
1145
+ */
1146
+ declare const admittedPermitBrand: unique symbol;
1147
+ interface AdmittedPermit {
1148
+ readonly [admittedPermitBrand]: 'dbsp-admitted-permit';
1149
+ }
1150
+ /** Fields shared by every fixed plan-time outcome claim. */
1151
+ interface OutcomeClaimPlanBase {
1152
+ readonly claimId: string;
1153
+ /** One actual apply attempt; deliberately distinct from the persisted run id. */
1154
+ readonly executionId?: string;
1155
+ /** Digest-covered logical position of this claim in the reviewed plan. */
1156
+ readonly plannedClaimKey?: string;
1157
+ /** The atomic closure identity; a single-address claim uses its root claim id. */
1158
+ readonly claimGroupId?: string;
1159
+ readonly address: LedgerAddress;
1160
+ readonly claimKind: LedgerClaimKind;
1161
+ /**
1162
+ * A creation verifies that its target address remains vacant before DDL.
1163
+ * Absent only on plans written before this material was introduced.
1164
+ */
1165
+ readonly requiresVacancy?: boolean;
1166
+ readonly declared?: LedgerPayload;
1167
+ readonly pairId?: string;
1168
+ }
1169
+ /** A claim that owns a manifest-bound SQL bundle. */
1170
+ interface SqlBearingOutcomeClaimPlan extends OutcomeClaimPlanBase {
1171
+ readonly claimSpecies: 'sql-bearing';
1172
+ readonly rootClaimId?: string;
1173
+ readonly statementBundle: ClaimStatementBundle;
1174
+ }
1175
+ /** Adoption records a present live object but deliberately sends no SQL. */
1176
+ interface AdoptionOutcomeClaimPlan extends OutcomeClaimPlanBase {
1177
+ readonly claimSpecies: 'adoption';
1178
+ readonly rootClaimId?: string;
1179
+ readonly claimKind: 'adopt-intent';
1180
+ readonly statementBundle: EmptyClaimStatementBundle;
1181
+ }
1182
+ /** A closure member whose terminal fact is covered by its root claim's SQL. */
1183
+ interface CascadeCoveredOutcomeClaimPlan extends OutcomeClaimPlanBase {
1184
+ readonly claimSpecies: 'cascade-covered';
1185
+ /** The SQL-bearing destructive root that covers this member. */
1186
+ readonly rootClaimId: string;
1187
+ readonly statementBundle: EmptyClaimStatementBundle;
1188
+ }
1189
+ /** A caller-supplied transactional application step recorded at a schema address. */
1190
+ interface ApplicationStepOutcomeClaimPlan extends OutcomeClaimPlanBase {
1191
+ readonly claimSpecies: 'application-step';
1192
+ readonly claimKind: 'intent';
1193
+ readonly statementBundle: EmptyClaimStatementBundle;
1194
+ /** `once` may only claim an unknown chain; `assert` may repair its managed chain. */
1195
+ readonly applicationStep: 'once' | 'assert';
1196
+ readonly declared: LedgerPayload;
1197
+ }
1198
+ /** The fixed plan-time material that becomes one ledger claim. */
1199
+ type OutcomeClaimPlan = SqlBearingOutcomeClaimPlan | AdoptionOutcomeClaimPlan | CascadeCoveredOutcomeClaimPlan | ApplicationStepOutcomeClaimPlan;
1200
+ /** The only successful result of admission, including its single-use token. */
1201
+ interface AdmittedOutcomeClaim {
1202
+ readonly kind: 'admitted-outcome-claim';
1203
+ readonly plan: OutcomeClaimPlan;
1204
+ readonly stableStateBeforeClaim: LedgerStableState;
1205
+ readonly token: ClaimToken;
1206
+ }
1207
+ /** Every refusal retains the subject's server or admission words. */
1208
+ interface OutcomeProtocolRefusal {
1209
+ readonly kind: 'outcome-protocol-refused';
1210
+ readonly reason: string;
1211
+ }
1212
+ type OutcomeClaimAdmission = AdmittedOutcomeClaim | OutcomeProtocolRefusal;
1213
+ /** A typed live-vacancy result supplied by the catalogue-specific reader. */
1214
+ type OutcomeVacancy = {
1215
+ readonly kind: 'vacant';
1216
+ } | {
1217
+ readonly kind: 'occupied';
1218
+ readonly reason: string;
1219
+ };
1220
+ /** A projected chain is always supplied to core admission as one unit. */
1221
+ interface OutcomeClaimAdmissionInput {
1222
+ readonly plan: OutcomeClaimPlan;
1223
+ readonly projection: LedgerChainProjection;
1224
+ /** Current role read by the adapter on the locked claiming session. */
1225
+ readonly currentController?: ControllerIdentity;
1226
+ /** Fresh locked catalogue identity for an existing managed address. */
1227
+ readonly liveAddress?: LedgerAddress;
1228
+ }
1229
+ /** Typed catalogue evidence used by outcome-protocol recovery. */
1230
+ type OutcomeRecoveryEffect = 'applied' | 'no-effect' | 'unverifiable';
1231
+ type OutcomeRecoveryReadBack = {
1232
+ readonly kind: 'absent';
1233
+ readonly effect?: OutcomeRecoveryEffect;
1234
+ } | {
1235
+ readonly kind: 'present';
1236
+ readonly catalogueIdentity: CatalogueIdentity;
1237
+ /** The canonical shape read from the live catalogue. */
1238
+ readonly observed: LedgerPayload;
1239
+ /** Operation-specific read-back when the catalogue presence is insufficient. */
1240
+ readonly effect?: OutcomeRecoveryEffect;
1241
+ };
1242
+ /** A failed read is evidence of nothing, and therefore permits no append. */
1243
+ interface OutcomeCatalogueUnavailable {
1244
+ readonly kind: 'catalogue-unavailable';
1245
+ readonly reason: string;
1246
+ }
1247
+ type OutcomeRecoveryCatalogueRead = OutcomeRecoveryReadBack | OutcomeCatalogueUnavailable;
1248
+ /** The catalogue boundary is injected so core has no database dependency. */
1249
+ type OutcomeRecoveryCatalogueReader = (address: LedgerAddress) => Promise<OutcomeRecoveryCatalogueRead>;
1250
+ /** A recovery append has one canonical predecessor/payload comparison shape. */
1251
+ interface OutcomeRecoveryResolution {
1252
+ readonly eventKind: 'refused' | 'observed' | 'absent' | 'indeterminate' | 'resolved';
1253
+ readonly predecessor: string;
1254
+ readonly rootClaimId: string;
1255
+ readonly reason: string;
1256
+ readonly readBack: OutcomeRecoveryReadBack;
1257
+ /** Present exactly when recovery closes the open claim as refused. */
1258
+ readonly refusal?: LedgerRefusal;
1259
+ }
1260
+ type OutcomeRecoveryClassification = {
1261
+ readonly kind: 'outcome-recovery-append';
1262
+ readonly address: LedgerAddress;
1263
+ readonly resolution: OutcomeRecoveryResolution;
1264
+ } | {
1265
+ readonly kind: 'outcome-recovery-pending';
1266
+ readonly address: LedgerAddress;
1267
+ readonly reason: string;
1268
+ /** A catalogue failure is a named pre-append refusal, not a retry hint. */
1269
+ readonly reasonCode?: 'catalogue-unavailable';
1270
+ } | {
1271
+ readonly kind: 'outcome-recovery-blocked';
1272
+ readonly address: LedgerAddress;
1273
+ readonly reason: string;
1274
+ } | {
1275
+ readonly kind: 'outcome-recovery-no-open-claim';
1276
+ readonly address: LedgerAddress;
1277
+ } | {
1278
+ readonly kind: 'outcome-recovery-malformed-chain';
1279
+ readonly address: LedgerAddress;
1280
+ readonly reason: string;
1281
+ };
1282
+ /**
1283
+ * Claim-bound evidence required before an interrupted creation or modification
1284
+ * can be attributed to DBSP. The adapter reconstructs these values from the
1285
+ * durable run, admitted operation and scoped authorization while holding its
1286
+ * run and ledger locks; a same-name catalogue object is never this evidence.
1287
+ */
1288
+ interface OutcomeIndeterminateRecoveryEvidence {
1289
+ readonly runId: string;
1290
+ readonly planDigest: string;
1291
+ readonly executionId: string;
1292
+ readonly claimId: string;
1293
+ readonly plannedClaimKey?: string;
1294
+ /** Digest recorded when the exact admitted statement bundle was minted. */
1295
+ readonly admittedBundleDigest: string;
1296
+ /** Digest re-read from the persisted operation at resolution time. */
1297
+ readonly persistedBundleDigest: string;
1298
+ readonly recordedPreState: 'unknown' | 'managed' | 'absent';
1299
+ readonly externalDdlExclusion: {
1300
+ readonly planDigest: string;
1301
+ readonly address: LedgerAddress;
1302
+ readonly trustRoot: string;
1303
+ };
1304
+ }
1305
+ interface OutcomeRecoveryInput {
1306
+ readonly projection: LedgerChainProjection;
1307
+ readonly catalogue: OutcomeRecoveryCatalogueReader;
1308
+ /** Accepted with the interrupted run, never inferred from a current policy. */
1309
+ readonly acceptedExternalDdlExclusion: boolean;
1310
+ /** Required for resolving an indeterminate creation or modification. */
1311
+ readonly indeterminateEvidence?: OutcomeIndeterminateRecoveryEvidence;
1312
+ /** Only an explicit reconciliation path may close an indeterminate claim. */
1313
+ readonly resolveIndeterminate?: boolean;
1314
+ }
1315
+
1316
+ /**
1317
+ * The generator and recorded transition planner share this immutable execution
1318
+ * vocabulary. It intentionally does not reuse GuardedPlanStep: generated DDL
1319
+ * has no transition-operation graph or fingerprint protocol, but it must carry
1320
+ * the complete claim, SQL, selection, and replay contract before it is shown.
1321
+ */
1322
+ type ManagedStepClassification = 'non-destructive' | 'removal' | 'data-destructive' | 'paired-readdress';
1323
+ type ManagedStepReplayPolicy = 'recorded' | 'fresh-live-only';
1324
+ interface ManagedStepClosureMember {
1325
+ readonly plannedClaimKey: string;
1326
+ readonly address: DeclarableResourceAddress & {
1327
+ readonly scope: 'schema' | 'database';
1328
+ };
1329
+ }
1330
+ interface ManagedStepSelectionRequirement {
1331
+ readonly kind: 'replacement' | 'adoption' | 'readdress' | 'optional-action';
1332
+ readonly selector: string;
1333
+ }
1334
+ /**
1335
+ * Reviewed lifecycle material. It lives beside the claim and SQL in the
1336
+ * normalized manifest; generator provenance is never an execution source.
1337
+ */
1338
+ type ManagedStepLifecycle = {
1339
+ readonly kind: 'adoption';
1340
+ readonly shape: TableIR;
1341
+ } | {
1342
+ readonly kind: 'sequence-adoption';
1343
+ readonly shape: SequenceIR;
1344
+ } | {
1345
+ readonly kind: 'adoption-refused';
1346
+ } | {
1347
+ readonly kind: 'readdress';
1348
+ readonly declaration: TableReaddressDeclaration;
1349
+ };
1350
+ /** A digest-covered, ordered unit of managed DDL. */
1351
+ interface NormalizedManagedStep {
1352
+ readonly stepKey: string;
1353
+ readonly order: number;
1354
+ readonly segmentId: string;
1355
+ readonly dependencyOrder: readonly string[];
1356
+ /** Root address, unless the operation declares a destructive closure root. */
1357
+ readonly address?: DeclarableResourceAddress & {
1358
+ readonly scope: 'schema' | 'database';
1359
+ };
1360
+ readonly closure?: {
1361
+ readonly root: DeclarableResourceAddress & {
1362
+ readonly scope: 'schema' | 'database';
1363
+ };
1364
+ readonly members: readonly ManagedStepClosureMember[];
1365
+ };
1366
+ readonly claimKind: LedgerClaimKind;
1367
+ readonly plannedClaimKeys: readonly string[];
1368
+ readonly statementBundle: ClaimStatementBundle;
1369
+ readonly classification: ManagedStepClassification;
1370
+ readonly requiresVacancy: boolean;
1371
+ readonly expectedDeclaration?: LedgerPayload;
1372
+ readonly expectedCatalogueIdentity?: CatalogueIdentity;
1373
+ readonly selection?: ManagedStepSelectionRequirement;
1374
+ readonly lifecycle?: ManagedStepLifecycle;
1375
+ readonly replayPolicy: ManagedStepReplayPolicy;
1376
+ }
1377
+ /**
1378
+ * Immutable managed-outcome material carried by a plan step. It is produced
1379
+ * while proving, covered by the plan digest, and is the only source an
1380
+ * executor may use for the address or statement bundle of a managed claim.
1381
+ */
1382
+ interface ManagedStepClaimMaterial {
1383
+ /** Legacy plan-local label retained for serialized-plan compatibility; never a ledger event id. */
1384
+ readonly claimId: string;
1385
+ /** Stable only inside this persisted plan; execution mints the claim id. */
1386
+ readonly plannedClaimKey: string;
1387
+ readonly address: DeclarableResourceAddress & {
1388
+ readonly scope: 'schema' | 'database';
1389
+ };
1390
+ readonly claimKind: LedgerClaimKind;
1391
+ readonly statementBundle: ClaimStatementBundle;
1392
+ /** True only when the plan writes an address it did not read. */
1393
+ readonly requiresVacancy: boolean;
1394
+ }
725
1395
  interface ExecutableAssertion {
726
1396
  readonly proposition: Proposition;
727
1397
  readonly scope: readonly ResourceAddress[];
@@ -729,6 +1399,8 @@ interface ExecutableAssertion {
729
1399
  interface DurableIntentRecord {
730
1400
  readonly runId?: string;
731
1401
  readonly run?: TransitionRunMetadata;
1402
+ /** One apply attempt, deliberately distinct from the durable reviewed run. */
1403
+ readonly executionId?: string;
732
1404
  readonly stepId: string;
733
1405
  readonly operation: PhysicalOperation;
734
1406
  readonly recordedAt: string;
@@ -751,6 +1423,8 @@ interface TransitionRunMetadata {
751
1423
  readonly databaseId: string;
752
1424
  readonly coreVersion: string;
753
1425
  readonly startedAt: string;
1426
+ /** Generator removal runs are inspectable but must be freshly re-planned. */
1427
+ readonly replayability?: 'replayable' | 'non-replayable-generator-removal';
754
1428
  }
755
1429
  type TransitionJournalEventName = 'intent' | 'completion' | 'observed';
756
1430
  type TransitionJournalEventRecord = DurableIntentRecord | TransactionalCompletionRecord | StepJournal;
@@ -767,6 +1441,24 @@ interface TransitionJournalEvent {
767
1441
  interface TransitionRunJournal {
768
1442
  readonly run: TransitionRunMetadata;
769
1443
  readonly events: readonly TransitionJournalEvent[];
1444
+ /** Run-level approval records are deliberately not step attempts. */
1445
+ readonly authorizations?: readonly TransitionRunAuthorization[];
1446
+ }
1447
+ /**
1448
+ * The audit record made before a durable plan may begin execution. Keeping it
1449
+ * outside the step event stream means a crash after authorization is retryable:
1450
+ * pristine means no intent, completion, or observed step event.
1451
+ */
1452
+ interface TransitionRunAuthorization {
1453
+ readonly runId: string;
1454
+ readonly policy: readonly AssumptionAcceptance[];
1455
+ readonly grants: readonly {
1456
+ readonly assumptionId: string;
1457
+ readonly grant: number;
1458
+ }[];
1459
+ readonly digest: string;
1460
+ readonly actor: string;
1461
+ readonly authorizedAt: string;
770
1462
  }
771
1463
  type StepOutcome = 'completed' | 'guard-failed' | 'guard-timeout' | 'context-mismatch' | 'operation-failed-not-applied' | 'partially-applied' | 'unknown-step-result';
772
1464
  interface StepJournalBase {
@@ -806,6 +1498,8 @@ interface GuardedPlanStep {
806
1498
  readonly guards: readonly ApplyGuard[];
807
1499
  readonly restsOnAssumptions: readonly AssumptionId[];
808
1500
  readonly selectionRationale: RuleSelectionRationale;
1501
+ /** Present exactly for a managed DDL operation with a fixed plan-time sink. */
1502
+ readonly managedClaim?: ManagedStepClaimMaterial;
809
1503
  }
810
1504
  interface GuardedPlanSegment {
811
1505
  readonly segmentId: string;
@@ -822,7 +1516,11 @@ interface GuardedPlan {
822
1516
  readonly segments: readonly GuardedPlanSegment[];
823
1517
  readonly steps: readonly GuardedPlanStep[];
824
1518
  readonly postconditions: readonly ExecutableAssertion[];
825
- /** Present on plans emitted by current `dbsp plan` and covered by its digest. */
1519
+ /**
1520
+ * Present on plans emitted by current `dbsp plan`. It remains optional in
1521
+ * the TypeScript shape solely so recovery can read historic documents; new
1522
+ * execution rejects an absent contract before taking intent.
1523
+ */
826
1524
  readonly executionContract?: ExecutionContract;
827
1525
  }
828
1526
  type ProvenGuardProtocol = Exclude<GuardProtocol, {
@@ -836,6 +1534,11 @@ interface ProvenPlanStep extends Omit<GuardedPlanStep, 'guards'> {
836
1534
  }
837
1535
  interface ProvenPlanShape extends Omit<GuardedPlan, 'steps'> {
838
1536
  readonly steps: readonly ProvenPlanStep[];
1537
+ /**
1538
+ * Present on newly persisted declarative runs. It is inside the plan document
1539
+ * deliberately: the plan digest therefore covers the declaration set.
1540
+ */
1541
+ readonly declarations?: DeclarationSet;
839
1542
  }
840
1543
  /**
841
1544
  * Plain serializable audit/dump format. A future
@@ -844,6 +1547,10 @@ interface ProvenPlanShape extends Omit<GuardedPlan, 'steps'> {
844
1547
  */
845
1548
  type SerializedProvenPlan = ProvenPlanShape;
846
1549
 
1550
+ /** Stable phase-owned result of a durable apply attempt. */
1551
+ type DurableApplyOutcome = 'completed' | 'operation-failed-not-applied' | 'partially-applied' | 'unknown-step-result' | 'outcome-unknown' | 'guard-failed' | 'guard-timeout' | 'context-mismatch' | 'transactional-only-refusal' | 'digest-mismatch' | 'prior-step-events-refusal' | 'compatibility-refusal' | 'assumption-not-accepted' | 'authorization-write-failed' | 'execution-contract-refused' | 'execution-preflight-failed' | 'execution-failed' | 'operation-unavailable' | 'plan-validation-failed' | 'run-id-mismatch' | 'load-failed' | 'plan-digest-mismatch' | 'database-read-only' | 'recovery-required' | 'transport-ambiguous';
1552
+ /** Stable phase-owned result of recovery classification. */
1553
+ type RecoveryOutcome = 'completed' | 'recovery-resume-required' | 'recovery-partially-applied' | 'recovery-unknown-step-result' | 'recovery-guard-failed' | 'recovery-guard-timeout' | 'recovery-operation-failed-not-applied' | 'recovery-context-mismatch' | 'recovery-read-failed';
847
1554
  interface ApplyResult {
848
1555
  readonly assessment: PlanAssessment;
849
1556
  readonly journals: readonly StepJournal[];
@@ -853,6 +1560,19 @@ interface ApplyResult {
853
1560
  readonly protocol: ProvenGuardProtocol['kind'];
854
1561
  readonly artefact: RecoveryArtefact;
855
1562
  }[];
1563
+ /** Present only on the durable-apply entry point. */
1564
+ readonly durableOutcome?: DurableApplyOutcome;
1565
+ /** Present only on the recovery entry point. */
1566
+ readonly recoveryOutcome?: RecoveryOutcome;
1567
+ /** An admitted managed claim remains unresolved and must not be retried. */
1568
+ readonly unresolvedOutcome?: {
1569
+ readonly kind: 'recovery-required';
1570
+ readonly claimId: string;
1571
+ readonly detail: string;
1572
+ } | {
1573
+ readonly kind: 'transport-ambiguous';
1574
+ readonly detail: string;
1575
+ };
856
1576
  }
857
1577
 
858
1578
  type EvidenceClaimConclusion = 'established' | 'undischarged' | 'refuted' | 'conflicted';
@@ -965,6 +1685,15 @@ interface TransitionSessionClient {
965
1685
  }
966
1686
  interface TransitionQueryClient {
967
1687
  query(sql: string, params?: unknown): Promise<TransitionQueryResult>;
1688
+ /**
1689
+ * Execute a statement contributed by a plan operation.
1690
+ *
1691
+ * This is intentionally a separate, optional channel rather than a SQL
1692
+ * classifier. Core only routes the client it gives to executeOperation()
1693
+ * through it; adapter-owned preflight, journalling, and cleanup continue to
1694
+ * use query().
1695
+ */
1696
+ queryPlanOperation?(sql: string, params?: unknown): Promise<TransitionQueryResult>;
968
1697
  release(error?: unknown): void;
969
1698
  }
970
1699
  declare const transitionLessorTypeBrand: unique symbol;
@@ -982,6 +1711,19 @@ interface TransitionLessor {
982
1711
  */
983
1712
  readonly acquire: () => Promise<TransitionQueryClient>;
984
1713
  }
1714
+ declare const exclusiveTransitionTargetTypeBrand: unique symbol;
1715
+ /**
1716
+ * A callback-scoped target for durable execution.
1717
+ *
1718
+ * Adapters mint this only after they have acquired their exclusive backend
1719
+ * lease. Its representation deliberately has no public members: core is the
1720
+ * only package that can turn it back into a query lease. This is a nominal
1721
+ * accidental-misuse guard, not a security boundary against code which imports
1722
+ * core's public factory deliberately.
1723
+ */
1724
+ interface ExclusiveTransitionTarget {
1725
+ readonly [exclusiveTransitionTargetTypeBrand]: never;
1726
+ }
985
1727
  interface OperationEffectAssessment {
986
1728
  readonly effects: OperationEffects;
987
1729
  readonly restsOn: readonly Assumption[];
@@ -1114,13 +1856,56 @@ interface Comparator {
1114
1856
  compare(desired: ModelIR, current: ModelIR, context?: EquivalenceContext): CompareOutcome;
1115
1857
  }
1116
1858
 
1117
- interface AssumptionAcceptance {
1118
- readonly class: string;
1119
- readonly fromTrustRoot?: TrustRoot;
1120
- readonly withinScope?: readonly ResourceSelector[];
1859
+ /** The two destructive effects defined by the managed-ledger authority table. */
1860
+ type DestructiveAction = {
1861
+ readonly kind: 'removal';
1862
+ readonly address: LedgerAddress;
1863
+ /** Digest of the exact cascade set admitted under the ledger locks. */
1864
+ readonly closureDigest?: string;
1865
+ } | {
1866
+ readonly kind: 'data-destructive';
1867
+ readonly address: LedgerAddress;
1868
+ };
1869
+ type DeclarationDestructiveOutcome = 'requires-removal' | 'requires-lossy-change' | 'replacement-requested-by-plan' | 'requires-neither' | 'absent' | 'uncomputable';
1870
+ type OwnershipDestructiveOutcome = 'managed-by-me' | 'managed-by-other' | 'pending' | 'blocked' | 'unknown' | 'uncomputable';
1871
+ type CatalogueIdentityDestructiveOutcome = 'matches-recorded' | 'differs' | 'object-absent' | 'catalogue-unavailable';
1872
+ type OperatorAcceptanceDestructiveOutcome = 'destructive-plan-accepted' | 'absent';
1873
+ type ContainmentClosureDestructiveOutcome = 'all-contained-or-managed' | 'reaches-unmanaged' | 'undecidable';
1874
+ type LedgerLineageDestructiveOutcome = 'matches-database' | 'differs' | 'unreadable';
1875
+ /** Closed evidence supplied to the sole destructive-decision interpreter. */
1876
+ interface DestructiveAuthorityEvidence {
1877
+ readonly declaration: DeclarationDestructiveOutcome;
1878
+ /** Present only for replacement-requested-by-plan; it limits that permit. */
1879
+ readonly replacementAddress?: LedgerAddress;
1880
+ readonly ownership: OwnershipDestructiveOutcome;
1881
+ readonly catalogueIdentity: CatalogueIdentityDestructiveOutcome;
1882
+ readonly operatorAcceptance: OperatorAcceptanceDestructiveOutcome;
1883
+ /** Required only for removals. */
1884
+ readonly containment?: ContainmentClosureDestructiveOutcome;
1885
+ /** The exact live cascade member that made `reaches-unmanaged` refuse. */
1886
+ readonly containmentUnmanaged?: LedgerAddress;
1887
+ /** The live catalogue error that made containment undecidable. */
1888
+ readonly containmentReason?: string;
1889
+ readonly ledgerLineage: LedgerLineageDestructiveOutcome;
1890
+ }
1891
+ declare const destructiveAuthorityPermitBrand: unique symbol;
1892
+ /**
1893
+ * Opaque positive evidence. It has no constructible fields, so an execution
1894
+ * sink can require it without accepting a caller-assembled set of booleans.
1895
+ */
1896
+ interface DestructiveAuthorityPermit {
1897
+ readonly [destructiveAuthorityPermitBrand]: 'dbsp-destructive-authority-permit';
1121
1898
  }
1122
- interface ApplyPolicy {
1123
- readonly accepts: readonly AssumptionAcceptance[];
1899
+ interface PermittedDestructiveDecision {
1900
+ readonly kind: 'destructive-decision-permitted';
1901
+ readonly action: DestructiveAction;
1902
+ readonly permit: DestructiveAuthorityPermit;
1903
+ }
1904
+ interface RefusedDestructiveDecision {
1905
+ readonly kind: 'destructive-decision-refused';
1906
+ readonly action: DestructiveAction;
1907
+ readonly reasons: readonly string[];
1124
1908
  }
1909
+ type DestructiveDecision = PermittedDestructiveDecision | RefusedDestructiveDecision;
1125
1910
 
1126
- export { AdjacencyTraversal, type AdvisoryObservation, type AdvisoryObservationId, AggregateWindowFunction, type ApplicableAssessment, type ApplicableEvaluation, type ApplyGuard, type ApplyPolicy, type ApplyResult, type Assumption, type AssumptionAcceptance, type AssumptionId, type BigintJsReadConversionContext, type BoundBinding, type CapabilityAvailabilityPredicate, type CapabilityDescriptor, type ClaimConclusion, type ClaimDerivation, type ClaimId, type ClaimSelector, CoalesceExpressionIntent, type CollationRef, ColumnAliasIntent, ColumnJsReadType, ColumnListInput, type Comparator, type CompareOutcome, type CompositionFactSatisfactionOwner, type ContextFact, type ContextMutation, CustomTraversal, DeleteIntent, type DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EdgeTableTraversal, type EquivalenceCapability, type EquivalenceContext, type EquivalenceResult, type EvidenceClaimConclusion, type EvidenceClaimResult, type EvidenceId, type EvidenceObservation, type EvidenceObservationFilters, type EvidenceView, type ExecutableAssertion, type ExecutionContract, type ExecutionRequirement, type ExecutionRequirementMode, type ExpressionEquivalenceCategory, ExpressionIntent, type ExpressionValue, type ExternalEffectCoverage, type FingerprintManifest, ForeignKeyIR, type GuardPredicate, type GuardProtocol, type GuardProtocolKind, type GuardedPlan, type GuardedPlanSegment, type GuardedPlanStep, type InapplicableAssessment, InsertIntent, type IssuedObservation, type JsonAggOrderKey, type JsonValue, type LoadedSchema, type LockRequirement, ModelIR, MutationIntent, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, type ObservationBooleanClaim, type ObservationContext, type ObservationIssuer, type ObservationPrivilegeMergeResult, type ObservationRequest, type ObservationResult, type ObservationStability, type ObservedOutcomeRecord, OffsetWindowFunction, type OperationEffectAssessment, type OperationEffects, type OperationExecutionOutcome, type OperationExecutionSemantics, OperationKindRef, type OperationRecoverySemantics, type OperationSemantics, type OutcomeReason, type OutcomeReasonCode, type PhysicalOperation, type PlanAssessment, type PortableExpression, type PostgreSqlAuthorityRequirement, type PostgreSqlEngineRequirement, type PostgreSqlNamespaceIdentity, type PostgreSqlObservationTargetIdentity, type PostgreSqlPhysicalTargetRequirement, type PostgreSqlSessionSettingRequirement, type ProofClaim, type ProofClaimDraft, type ProofEvidenceAccess, type ProofObligation, type Proposition, type ProvenApplyGuard, type ProvenGuardProtocol, type ProvenPlanShape, type ProvenPlanStep, QueryIntent, RankingWindowFunction, RawExpressionIntent, type RecognitionContext, type RecognitionResult, type RecoveryArtefact, RecursiveIntent, RecursiveTraversal, RelationColumnIntent, RelationIR, type RelationKeyBuilderOptions, type RelationKeyDirection, type RelationKeyFields, type RelationKeyForeignKey, type ResourceAddress, type ResourceSelector, type RuleEvaluation, type RulePrecedenceFact, type RuleRef, type RuleSelectionRationale, type RuleSupport, SelectAggregateIntent, SelectAllIntent, SelectFieldsIntent, SelectIntent, SelectWithExpressionsIntent, SemanticArtifactRef, type SerializedProvenPlan, type StepJournal, type StepOutcome, SubqueryRefIntent, TableIR, type TargetBinding, type TransactionalCompletionRecord, type TransitionCandidate, type TransitionCompositionFact, type TransitionFragment, type TransitionFragmentComposition, type TransitionJournalEvent, type TransitionJournalEventName, type TransitionJournalEventRecord, type TransitionLessor, type TransitionQueryClient, type TransitionQueryResult, type TransitionRule, type TransitionRunJournal, type TransitionRunMetadata, type TransitionSessionClient, TrustRoot, type TypeRef, type UnknownCoverage, type UnknownTransitionRecognition, type UnresolvableExpression, type UnsafeNativeFragment, UpdateIntent, UpsertIntent, type VendorValidatedExpression, WhereAndIntent, WhereAnyIntent, WhereComparisonIntent, WhereExistsIntent, WhereInIntent, WhereIntent, WhereLikeIntent, WhereNotExistsIntent, WhereNotIntent, WhereNullIntent, WhereOrIntent, WhereRangeIntent, WhereRelationFilterIntent, WhereSubqueryIntent, WindowFunction, WindowIntent, buildRelationKeyFields, convertBigintJsReadValue, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, resolveJsonAggOrderKey };
1911
+ export { AdjacencyTraversal, type AdmittedOutcomeClaim, type AdmittedPermit, type AdoptionOutcomeClaimPlan, type AdvisoryObservation, type AdvisoryObservationId, AggregateWindowFunction, type ApplicableAssessment, type ApplicableEvaluation, type ApplicationStepOutcomeClaimPlan, type ApplyGuard, type ApplyPolicy, type ApplyResult, type Assumption, type AssumptionAcceptance, type AssumptionId, type BigintJsReadConversionContext, type BoundBinding, type CapabilityAvailabilityPredicate, type CapabilityDescriptor, type CascadeCoveredOutcomeClaimPlan, type CatalogueIdentity, type CatalogueIdentityDestructiveOutcome, type ClaimBundleStatement, type ClaimConclusion, type ClaimDerivation, type ClaimId, type ClaimSelector, type ClaimStatementBundle, type ClaimToken, CoalesceExpressionIntent, type CollationRef, ColumnAliasIntent, ColumnJsReadType, ColumnListInput, type Comparator, type CompareOutcome, type CompositionFactSatisfactionOwner, type ContainmentClosureDestructiveOutcome, type ContextFact, type ContextMutation, type ControllerIdentity, CustomTraversal, type DeclarableKind, type DeclarableResourceAddress, type DeclarationDestructiveOutcome, type DeclarationSet, DeleteIntent, type DestructiveAction, type DestructiveAuthorityEvidence, type DestructiveAuthorityPermit, type DestructiveDecision, type DurableApplyOutcome, type DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EdgeTableTraversal, type EmptyClaimStatementBundle, type EquivalenceCapability, type EquivalenceContext, type EquivalenceResult, type EvidenceClaimConclusion, type EvidenceClaimResult, type EvidenceId, type EvidenceObservation, type EvidenceObservationFilters, type EvidenceView, type ExclusiveTransitionTarget, type ExecutableAssertion, type ExecutionContract, type ExecutionRequirement, type ExecutionRequirementMode, type ExpressionEquivalenceCategory, ExpressionIntent, type ExpressionValue, type ExternalEffectCoverage, type FingerprintManifest, ForeignKeyIR, type GuardPredicate, type GuardProtocol, type GuardProtocolKind, type GuardedPlan, type GuardedPlanSegment, type GuardedPlanStep, type InapplicableAssessment, InsertIntent, type IssuedObservation, type JsonAggOrderKey, type JsonObject, type JsonValue, LEDGER_EVENT_KINDS, type LedgerAddress, type LedgerChainMember, type LedgerChainProjection, type LedgerClaimKind, type LedgerEventKind, type LedgerHome, type LedgerIdentity, type LedgerLifecycleGrammarColumn, type LedgerLineageDestructiveOutcome, type LedgerMarkerState, type LedgerOpenClaim, type LedgerPayload, type LedgerRefusal, type LedgerReportedState, type LedgerReservationRow, type LedgerShapeMarker, type LedgerStableState, type LoadedSchema, type LockRequirement, type LogicalNameAddress, type ManagedDeclaration, type ManagedStepClaimMaterial, type ManagedStepClassification, type ManagedStepClosureMember, type ManagedStepLifecycle, type ManagedStepReplayPolicy, type ManagedStepSelectionRequirement, ModelIR, MutationIntent, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, type NormalizedManagedStep, type ObservationBooleanClaim, type ObservationContext, type ObservationIssuer, type ObservationPrivilegeMergeResult, type ObservationRequest, type ObservationResult, type ObservationStability, type ObservedOutcomeRecord, OffsetWindowFunction, type OperationEffectAssessment, type OperationEffects, type OperationExecutionOutcome, type OperationExecutionSemantics, OperationKindRef, type OperationRecoverySemantics, type OperationSemantics, type OperatorAcceptanceDestructiveOutcome, type OutcomeCatalogueUnavailable, type OutcomeClaimAdmission, type OutcomeClaimAdmissionInput, type OutcomeClaimPlan, type OutcomeIndeterminateRecoveryEvidence, type OutcomeProtocolRefusal, type OutcomeReason, type OutcomeReasonCode, type OutcomeRecoveryCatalogueRead, type OutcomeRecoveryCatalogueReader, type OutcomeRecoveryClassification, type OutcomeRecoveryEffect, type OutcomeRecoveryInput, type OutcomeRecoveryReadBack, type OutcomeRecoveryResolution, type OutcomeVacancy, type OwnershipDestructiveOutcome, type PermittedDestructiveDecision, type PhysicalNameEntry, type PhysicalNameInventory, PhysicalNameInventoryDuplicateError, PhysicalNameInventoryMissingError, type PhysicalOperation, type PlanAssessment, type PortableExpression, type PostgreSqlAuthorityRequirement, type PostgreSqlEngineRequirement, type PostgreSqlNamespaceIdentity, type PostgreSqlObservationTargetIdentity, type PostgreSqlPhysicalTargetRequirement, type PostgreSqlSessionSettingRequirement, type ProjectedLedgerChain, type ProofClaim, type ProofClaimDraft, type ProofEvidenceAccess, type ProofObligation, type Proposition, type ProvenApplyGuard, type ProvenGuardProtocol, type ProvenPlanShape, type ProvenPlanStep, QueryIntent, REFUSAL_VOCABULARY, RankingWindowFunction, RawExpressionIntent, type RecognitionContext, type RecognitionResult, type RecoveryArtefact, type RecoveryOutcome, RecursiveIntent, RecursiveTraversal, type RefusalCode, type RefusedDestructiveDecision, type ReinitializePreflightAdoptionCandidate, type ReinitializePreflightFailureReason, type ReinitializePreflightFailureStep, type ReinitializePreflightRefusalCode, type ReinitializePreflightReport, type ReinitializePreflightScopeOutcome, type ReinitializePreflightScopeReport, RelationColumnIntent, RelationIR, type RelationKeyBuilderOptions, type RelationKeyDirection, type RelationKeyFields, type RelationKeyForeignKey, type ResourceAddress, type ResourceSelector, type RuleEvaluation, type RulePrecedenceFact, type RuleRef, type RuleSelectionRationale, type RuleSupport, type ScopedApprovalSet, SelectAggregateIntent, SelectAllIntent, SelectFieldsIntent, SelectIntent, SelectWithExpressionsIntent, SemanticArtifactRef, SequenceIR, type SerializedProvenPlan, type SqlBearingOutcomeClaimPlan, type StepJournal, type StepOutcome, SubqueryRefIntent, TableIR, TableReaddressDeclaration, type TargetBinding, type TransactionalCompletionRecord, type TransitionCandidate, type TransitionCompositionFact, type TransitionFragment, type TransitionFragmentComposition, type TransitionJournalEvent, type TransitionJournalEventName, type TransitionJournalEventRecord, type TransitionLessor, type TransitionQueryClient, type TransitionQueryResult, type TransitionRule, type TransitionRunAuthorization, type TransitionRunJournal, type TransitionRunMetadata, type TransitionSessionClient, TrustRoot, type TypeRef, type UnknownCoverage, type UnknownTransitionRecognition, type UnprojectableChainReason, type UnprojectableLedgerChain, type UnresolvableExpression, type UnsafeNativeFragment, UpdateIntent, UpsertIntent, type VendorValidatedExpression, WhereAndIntent, WhereAnyIntent, WhereComparisonIntent, WhereExistsIntent, WhereInIntent, WhereIntent, WhereLikeIntent, WhereNotExistsIntent, WhereNotIntent, WhereNullIntent, WhereOrIntent, WhereRangeIntent, WhereRelationFilterIntent, WhereSubqueryIntent, WindowFunction, WindowIntent, buildRelationKeyFields, canonicalResourceParent, convertBigintJsReadValue, createPhysicalNameInventory, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, ledgerAddressKey, ledgerAddressParentJson, refusalFor, resolveJsonAggOrderKey, sameControllerIdentity, sameLedgerAddress };