@dbsp/types 3.3.0 → 4.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 { bU as RecursiveTraversal, e as AdjacencyTraversal, cZ as WindowFunction, l as AggregateWindowFunction, ba as OffsetWindowFunction, aj as ExpressionIntent, F as CoalesceExpressionIntent, G as ColumnAliasIntent, $ as CustomTraversal, bA as QueryIntent, bO as RecursiveIntent, aV as MutationIntent, a6 as DeleteIntent, af as EdgeTableTraversal, aA as InsertIntent, bE as RankingWindowFunction, bH as RawExpressionIntent, bW as RelationColumnIntent, c7 as SelectIntent, c4 as SelectAggregateIntent, c5 as SelectAllIntent, c6 as SelectFieldsIntent, c8 as SelectWithExpressionsIntent, cl as SubqueryRefIntent, cy as UpdateIntent, cC as UpsertIntent, cM as WhereIntent, cE as WhereAndIntent, cF as WhereAnyIntent, cG as WhereComparisonIntent, cH as WhereExistsIntent, cJ as WhereInIntent, cP as WhereLikeIntent, cT as WhereOrIntent, cR as WhereNotIntent, cQ as WhereNotExistsIntent, cS as WhereNullIntent, cU as WhereRangeIntent, cX as WhereRelationFilterIntent, cY as WhereSubqueryIntent, c_ as WindowIntent, J as ColumnJsReadType, co as TableIR, aU as ModelIR, K as ColumnListInput, bX as RelationIR, ap as ForeignKeyIR, ca as SemanticArtifactRef, cu as TrustRoot, bd as OperationKindRef } from './adapter-CBhAwQzd.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 CreateIndexOptions, Y as CteQueryIntent, Z as CustomFnExpressionIntent, _ as CustomOpExpressionIntent, a0 as DDLFeature, a1 as DDLFeatureElementMap, a2 as DDLFeatureVersionRange, a3 as DDLGeneratingAdapter, 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 PseudoColumnExpressionIntent, by as PseudoColumnMetadata, bz as PseudoColumnTraversal, bB as RangeOperand, bC as RangeOperator, bD as RangeValue, bF as RankingWindowIntent, bG as RawCteIntent, bI as RawSqlAdapter, bJ as RecursiveAdvancedOptions, bK as RecursiveDedupe, bL as RecursiveDirection, bM as RecursiveEmitOptions, bN as RecursiveExistsOptions, bP as RecursiveMetadata, bQ as RecursiveNodeIdExpr, bR as RecursivePlanOptions, bS as RecursivePlanReport, bT as RecursiveTrackOptions, bV as RefExpressionIntent, bY as RelationKind, bZ as RelationOperator, b_ as RelationType, b$ as RequiredEnumLabelIR, c0 as ResolvedIncludeStrategy, c1 as SQLiteColumnType, c2 as SchemaChange, c3 as SchemaDiff, c9 as SemanticArtifactId, cb as SequenceIR, cc as SetOperationIntent, cd as SetOperationType, ce as SimpleCteIntent, cf as SortDirection, cg as StarExpressionIntent, ch as StreamingAdapter, ci as StringOperator, cj as SubqueryExpressionIntent, ck as SubqueryIncludeInfo, cm as SupportedColumnTypes, cn as TableDDLGeneratorAdapter, cp as TransactionBeginOptions, cq as TransactionOptions, cr as TransactionalAdapter, cs as TranslationContext, ct as TruncateOptions, cv as UnaryExpressionIntent, cw as UnnestCteIntent, cx as UnsupportedFeatureBehavior, cz as UpsertConflictAction, cA as UpsertConflictTarget, cB as UpsertFromIntent, cD as VacuumOptions, cI as WhereExpressionIntent, cK as WhereInSubqueryIntent, cL as WhereInValueIntent, cN as WhereJsonContainsIntent, cO as WhereJsonExistsIntent, cV as WhereRawExistsIntent, cW as WhereRawNotExistsIntent, c$ as WindowOrderBy, d0 as getNodeIdAlias, d1 as isFieldRef, d2 as isParamIntent, d3 as resolveOutputReadHandling, d4 as toColumnList } from './adapter-CBhAwQzd.js';
1
+ import { bW as RecursiveTraversal, e as AdjacencyTraversal, d2 as WindowFunction, l as AggregateWindowFunction, bb as OffsetWindowFunction, ak as ExpressionIntent, F as CoalesceExpressionIntent, G as ColumnAliasIntent, a0 as CustomTraversal, bC as QueryIntent, bQ as RecursiveIntent, aW as MutationIntent, a7 as DeleteIntent, ag as EdgeTableTraversal, aB as InsertIntent, bG as RankingWindowFunction, bJ as RawExpressionIntent, bY as RelationColumnIntent, c9 as SelectIntent, c6 as SelectAggregateIntent, c7 as SelectAllIntent, c8 as SelectFieldsIntent, ca as SelectWithExpressionsIntent, co as SubqueryRefIntent, cD as UpdateIntent, cH as UpsertIntent, cR as WhereIntent, cJ as WhereAndIntent, cK as WhereAnyIntent, cL as WhereComparisonIntent, cM as WhereExistsIntent, cO as WhereInIntent, cU as WhereLikeIntent, cY as WhereOrIntent, cW as WhereNotIntent, cV as WhereNotExistsIntent, cX as WhereNullIntent, cZ as WhereRangeIntent, d0 as WhereRelationFilterIntent, d1 as WhereSubqueryIntent, d3 as WindowIntent, J as ColumnJsReadType, cr as TableIR, aV as ModelIR, K as ColumnListInput, bZ as RelationIR, aq as ForeignKeyIR, cc as SemanticArtifactRef, cz as TrustRoot, be as OperationKindRef, ct as TableReaddressDeclaration } from './adapter-B057_WKR.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 PredicateOperator, bz as PseudoColumnExpressionIntent, bA as PseudoColumnMetadata, bB as PseudoColumnTraversal, bD as RangeOperand, bE as RangeOperator, bF as RangeValue, bH as RankingWindowIntent, bI as RawCteIntent, bK as RawSqlAdapter, bL as RecursiveAdvancedOptions, bM as RecursiveDedupe, bN as RecursiveDirection, bO as RecursiveEmitOptions, bP as RecursiveExistsOptions, bR as RecursiveMetadata, bS as RecursiveNodeIdExpr, bT as RecursivePlanOptions, bU as RecursivePlanReport, bV as RecursiveTrackOptions, bX as RefExpressionIntent, b_ as RelationKind, b$ as RelationOperator, c0 as RelationType, c1 as RequiredEnumLabelIR, c2 as ResolvedIncludeStrategy, c3 as SQLiteColumnType, c4 as SchemaChange, c5 as SchemaDiff, cb as SemanticArtifactId, cd as SequenceIR, ce as SetOperationIntent, cf as SetOperationType, cg as SimpleCteIntent, ch as SortDirection, ci as StandaloneWhereExpressionIntent, cj as StarExpressionIntent, ck as StreamingAdapter, cl as StringOperator, cm as SubqueryExpressionIntent, cn as SubqueryIncludeInfo, cp as SupportedColumnTypes, cq as TableDDLGeneratorAdapter, cs as TableReaddressAddress, cu as TransactionBeginOptions, cv as TransactionOptions, cw as TransactionalAdapter, cx as TranslationContext, cy as TruncateOptions, cA as UnaryExpressionIntent, cB as UnnestCteIntent, cC as UnsupportedFeatureBehavior, cE as UpsertConflictAction, cF as UpsertConflictTarget, cG as UpsertFromIntent, cI as VacuumOptions, cN as WhereExpressionIntent, cP as WhereInSubqueryIntent, cQ as WhereInValueIntent, cS as WhereJsonContainsIntent, cT as WhereJsonExistsIntent, c_ as WhereRawExistsIntent, c$ as WhereRawNotExistsIntent, d4 as WindowOrderBy, d5 as getNodeIdAlias, d6 as isFieldRef, d7 as isParamIntent, d8 as resolveOutputReadHandling, d9 as toColumnList } from './adapter-B057_WKR.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
  }
@@ -252,18 +256,46 @@ interface FingerprintManifest {
252
256
  readonly digest: string;
253
257
  }
254
258
 
255
- type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
259
+ type JsonObject = {
256
260
  readonly [k: string]: JsonValue;
257
261
  };
262
+ type JsonValue = null | boolean | number | string | readonly JsonValue[] | JsonObject;
258
263
 
264
+ /** The managed catalogue kinds. This union is intentionally closed. */
265
+ type DeclarableKind = 'table' | 'column' | 'index' | 'constraint' | 'enum' | 'sequence' | 'extension';
266
+ /** Adapter-owned, versioned durable catalogue identity. */
267
+ interface CatalogueIdentity {
268
+ readonly engine: string;
269
+ readonly format: number;
270
+ readonly value: JsonObject;
271
+ }
272
+ /**
273
+ * The durable PostgreSQL role identity which controls a managed ledger entry.
274
+ * A role name alone is reusable after DROP/CREATE; the OID binds the record to
275
+ * the role that was actually present when the event was written.
276
+ */
277
+ interface ControllerIdentity {
278
+ readonly name: string;
279
+ readonly oid: string;
280
+ }
281
+ /** Compare the complete durable controller identity in one place. */
282
+ declare function sameControllerIdentity(recorded: ControllerIdentity, current: ControllerIdentity): boolean;
259
283
  interface ResourceAddress {
260
284
  readonly engine: string;
261
285
  readonly database: string;
262
286
  readonly schema?: string;
287
+ /** The containing object, for example an index or column's table. */
288
+ readonly parent?: ResourceAddress;
263
289
  readonly kind: string;
264
290
  readonly name: string;
291
+ /** Recorded catalogue identity. It is absent only for legacy/non-managed scope. */
292
+ readonly catalogueIdentity?: CatalogueIdentity;
265
293
  readonly qualifiedBy?: readonly string[];
266
294
  }
295
+ /** A managed declaration cannot spell a kind outside the declarable set. */
296
+ type DeclarableResourceAddress<K extends DeclarableKind = DeclarableKind> = Omit<ResourceAddress, 'kind'> & {
297
+ readonly kind: K;
298
+ };
267
299
  interface ResourceSelector {
268
300
  readonly kind?: string;
269
301
  readonly schema?: string;
@@ -271,6 +303,14 @@ interface ResourceSelector {
271
303
  readonly within?: ResourceAddress;
272
304
  }
273
305
 
306
+ interface PostgreSqlObservationTargetIdentity {
307
+ readonly systemIdentifier: string;
308
+ readonly databaseOid: string;
309
+ readonly namespaces: readonly {
310
+ readonly name: string;
311
+ readonly oid: string;
312
+ }[];
313
+ }
274
314
  type EvidenceId = string & {
275
315
  readonly __brand: 'EvidenceId';
276
316
  };
@@ -302,6 +342,8 @@ interface ObservationContext {
302
342
  readonly collationProvider?: string;
303
343
  readonly collationVersion?: string;
304
344
  readonly transaction?: string;
345
+ /** Read from PostgreSQL catalogs; no name-only fallback is permitted. */
346
+ readonly postgresqlTargetIdentity?: PostgreSqlObservationTargetIdentity;
305
347
  }
306
348
  type ObservationPrivilegeMergeResult = {
307
349
  readonly merged: readonly string[];
@@ -359,7 +401,7 @@ interface ProofObligation {
359
401
  }
360
402
  interface Assumption {
361
403
  readonly id: AssumptionId;
362
- readonly class: 'rule-effect-declaration' | 'user-blast-radius' | 'external-ddl-exclusion' | 'operation-pack-semantics' | 'baseline-identity-attachment' | (string & {});
404
+ readonly class: 'rule-effect-declaration' | 'user-blast-radius' | 'external-ddl-exclusion' | 'operation-pack-semantics' | 'baseline-identity-attachment' | 'non-transactional-segment' | (string & {});
363
405
  readonly asserter: TrustRoot;
364
406
  readonly statement: string;
365
407
  readonly scope: readonly ResourceAddress[];
@@ -481,6 +523,13 @@ interface ExternalEffectCoverage {
481
523
  }
482
524
  type OperationExecutionOutcome = {
483
525
  readonly kind: 'completed';
526
+ } | {
527
+ readonly kind: 'recovery-required';
528
+ readonly claimId: string;
529
+ readonly detail: string;
530
+ } | {
531
+ readonly kind: 'transport-ambiguous';
532
+ readonly detail: string;
484
533
  } | {
485
534
  readonly kind: 'guard-failed';
486
535
  readonly guard: ApplyGuard;
@@ -561,7 +610,7 @@ interface TransitionFragment {
561
610
  readonly selectionRationale: RuleSelectionRationale;
562
611
  }
563
612
 
564
- type OutcomeReasonCode = 'proven-applicable' | 'proven-inapplicable' | 'context-mismatch' | 'insufficient-evidence' | 'unsupported-transition' | 'ambiguous-rule' | 'uncomposable' | 'ambiguous-intent' | 'guard-failed' | 'guard-timeout' | 'operation-failed-not-applied' | 'partially-applied' | 'unknown-step-result' | 'resume-required';
613
+ type OutcomeReasonCode = 'proven-applicable' | 'proven-inapplicable' | 'context-mismatch' | 'persistence-failed' | 'insufficient-evidence' | 'unsupported-transition' | 'ambiguous-rule' | 'uncomposable' | 'ambiguous-intent' | 'guard-failed' | 'guard-timeout' | 'operation-failed-not-applied' | 'partially-applied' | 'unknown-step-result' | 'resume-required';
565
614
  interface OutcomeReasonBase {
566
615
  readonly detail?: string;
567
616
  readonly scope: readonly ResourceAddress[];
@@ -576,6 +625,10 @@ type OutcomeReason = (OutcomeReasonBase & {
576
625
  readonly code: 'context-mismatch';
577
626
  readonly artifact: SemanticArtifactRef;
578
627
  readonly fact: ContextFact;
628
+ }) | (OutcomeReasonBase & {
629
+ readonly code: 'persistence-failed';
630
+ readonly artifact: SemanticArtifactRef;
631
+ readonly fact: ContextFact;
579
632
  }) | (OutcomeReasonBase & {
580
633
  readonly code: 'insufficient-evidence';
581
634
  readonly obligation: ProofObligation;
@@ -641,24 +694,652 @@ type InapplicableAssessment = PlanAssessment & {
641
694
  readonly decision: 'inapplicable';
642
695
  };
643
696
 
697
+ interface AssumptionAcceptance {
698
+ readonly class: string;
699
+ readonly fromTrustRoot?: TrustRoot;
700
+ readonly withinScope?: readonly ResourceSelector[];
701
+ }
702
+ interface ApplyPolicy {
703
+ readonly accepts: readonly AssumptionAcceptance[];
704
+ }
705
+ /**
706
+ * The scoped approvals carried into admitted execution. This distinct input
707
+ * prevents execution boundaries from silently degrading reviewed scope to a
708
+ * bare list of approval-class strings.
709
+ */
710
+ interface ScopedApprovalSet {
711
+ readonly approvals: readonly AssumptionAcceptance[];
712
+ /** The authority root declared for this admitted policy evaluation. */
713
+ readonly declaredTrustRoot?: TrustRoot;
714
+ }
715
+
716
+ /**
717
+ * The closed set of durable declarative fragments. Consumers receive this
718
+ * type rather than a stringly kind so an undeclarable surface is impossible to
719
+ * express without extending the one union above.
720
+ */
721
+ interface ManagedDeclaration<K extends DeclarableKind = DeclarableKind> {
722
+ readonly address: DeclarableResourceAddress<K>;
723
+ readonly fragment: JsonValue;
724
+ /** SHA-256 of the canonical parsed fragment, never of storage bytes. */
725
+ readonly digest: string;
726
+ }
727
+ interface DeclarationSet {
728
+ readonly version: 1;
729
+ readonly declarations: readonly ManagedDeclaration[];
730
+ /** SHA-256 of the canonical parsed declaration set. */
731
+ readonly digest: string;
732
+ }
733
+
644
734
  /**
645
- * ProvenPlanShape is the serializable audit/dump shape of a plan the prover can
646
- * derive. It is not an apply credential: runtime safety comes from @dbsp/core
647
- * apply() accepting only an InProcessProvenPlan minted by this module instance's
648
- * prove() through a module-private WeakSet identity capability plus deep-freeze.
735
+ * Durable, reviewed conditions for executing a serialized transition plan.
649
736
  *
650
- * A serialized, cloned, or hand-forged shape is not authorized for apply(). A
651
- * separate future adoptSerializedPlan(serialized, observationContext) API
652
- * (stage: identity & adoption) will re-derive an in-process plan from fresh
653
- * observations; apply() must not be overloaded to accept serialized data.
737
+ * This is deliberately a small document format rather than a second copy of
738
+ * ObservationContext. Its requirements are canonicalized before persistence
739
+ * and are covered by the plan digest.
740
+ */
741
+ declare const EXECUTION_CONTRACT_VERSION: 1;
742
+ type ExecutionRequirementMode = 'must-match' | 'set-and-verify' | 'must-satisfy' | 'provenance';
743
+ interface PostgreSqlNamespaceIdentity {
744
+ readonly name: string;
745
+ readonly oid: string;
746
+ }
747
+ interface PostgreSqlPhysicalTargetRequirement {
748
+ readonly kind: 'postgresql.physical-target';
749
+ readonly mode: 'must-match';
750
+ readonly systemIdentifier: string;
751
+ readonly databaseOid: string;
752
+ /** Canonical lexical set, never a positional list. */
753
+ readonly namespaces: readonly PostgreSqlNamespaceIdentity[];
754
+ }
755
+ interface PostgreSqlEngineRequirement {
756
+ readonly kind: 'postgresql.engine-version';
757
+ readonly mode: 'must-satisfy';
758
+ readonly stepId: string;
759
+ readonly minServerVersionNum?: number;
760
+ readonly maxServerVersionNum?: number;
761
+ }
762
+ /** Authority is a capability over an object, never a role-name comparison. */
763
+ interface PostgreSqlAuthorityRequirement {
764
+ readonly kind: 'postgresql.authority';
765
+ readonly mode: 'must-satisfy';
766
+ readonly action: 'schema-usage' | 'table-alter' | 'type-alter';
767
+ readonly schema: string;
768
+ readonly object?: string;
769
+ }
770
+ interface PostgreSqlSessionSettingRequirement {
771
+ readonly kind: 'postgresql.session-setting';
772
+ readonly mode: 'set-and-verify' | 'provenance';
773
+ readonly setting: 'standard_conforming_strings' | 'search_path' | 'client_encoding' | 'TimeZone';
774
+ readonly value: string;
775
+ }
776
+ type ExecutionRequirement = PostgreSqlPhysicalTargetRequirement | PostgreSqlEngineRequirement | PostgreSqlAuthorityRequirement | PostgreSqlSessionSettingRequirement;
777
+ interface ExecutionContract {
778
+ readonly version: typeof EXECUTION_CONTRACT_VERSION;
779
+ /** A canonically ordered set. Unknown kinds and modes are invalid. */
780
+ readonly requirements: readonly ExecutionRequirement[];
781
+ }
782
+
783
+ /** The unit-9/SC-64 vocabulary is the one source for durable refusal prose. */
784
+ declare const REFUSAL_VOCABULARY: {
785
+ readonly 'ERR-01': {
786
+ readonly cause: "unaccepted non-transactional segment";
787
+ readonly withheldAuthority: "non-transactional execution authority";
788
+ readonly resolvingCommand: "dbsp apply";
789
+ };
790
+ readonly 'ERR-02': {
791
+ readonly cause: "pre-existing object has no admitted adoption";
792
+ readonly withheldAuthority: "creation authority over an occupied address";
793
+ readonly resolvingCommand: "dbsp apply";
794
+ };
795
+ readonly 'ERR-03': {
796
+ readonly cause: "managed-ledger preflight is not current";
797
+ readonly withheldAuthority: "managed-ledger mutation authority";
798
+ readonly resolvingCommand: "dbsp preflight --reinitialize";
799
+ };
800
+ readonly 'ERR-04': {
801
+ readonly cause: "removal containment cannot be proven";
802
+ readonly withheldAuthority: "destructive removal authority";
803
+ readonly resolvingCommand: "dbsp apply";
804
+ };
805
+ readonly 'ERR-05': {
806
+ readonly cause: "recorded identity differs from the live object";
807
+ readonly withheldAuthority: "managed mutation authority";
808
+ readonly resolvingCommand: "dbsp apply";
809
+ };
810
+ readonly 'ERR-06': {
811
+ readonly cause: "managed-ledger lineage does not match this target";
812
+ readonly withheldAuthority: "managed-ledger mutation authority";
813
+ readonly resolvingCommand: "dbsp preflight --reinitialize";
814
+ };
815
+ readonly 'ERR-07': {
816
+ readonly cause: "target database is read-only";
817
+ readonly withheldAuthority: "database write authority";
818
+ readonly resolvingCommand: "dbsp apply";
819
+ };
820
+ readonly 'ERR-08': {
821
+ readonly cause: "ledger chain is malformed";
822
+ readonly withheldAuthority: "managed mutation authority";
823
+ readonly resolvingCommand: "dbsp inspect";
824
+ };
825
+ readonly 'ERR-09': {
826
+ readonly cause: "catalogue read is unavailable";
827
+ readonly withheldAuthority: "outcome classification authority";
828
+ readonly resolvingCommand: "dbsp reconcile";
829
+ };
830
+ readonly 'ERR-10': {
831
+ readonly cause: "recorded-plan path cannot execute a removal";
832
+ readonly withheldAuthority: "recorded-plan removal execution";
833
+ readonly resolvingCommand: "dbsp apply";
834
+ };
835
+ readonly 'ERR-11': {
836
+ readonly cause: "recovery proved the interrupted operation had no effect";
837
+ readonly withheldAuthority: "recovery execution authority";
838
+ readonly resolvingCommand: "dbsp reconcile";
839
+ };
840
+ };
841
+ type RefusalCode = keyof typeof REFUSAL_VOCABULARY;
842
+ /** Bind a catalogue entry to the address state that existed at refusal time. */
843
+ declare function refusalFor(code: RefusalCode, input: Pick<LedgerRefusal, 'state'> & {
844
+ readonly address?: LedgerAddress;
845
+ }): LedgerRefusal;
846
+
847
+ /** The outcome protocol is closed at the fourteen ADR 0006 event kinds. */
848
+ 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"];
849
+ type LedgerEventKind = (typeof LEDGER_EVENT_KINDS)[number];
850
+ type LedgerClaimKind = Extract<LedgerEventKind, 'adopt-intent' | 'intent' | 'retire-intent' | 'readdress-intent'>;
851
+ /**
852
+ * A canonical address is recorded as columns by PostgreSQL and as this shape at
853
+ * the adapter boundary. `scope` selects exactly one physical ledger.
854
+ */
855
+ interface LedgerAddress extends ResourceAddress {
856
+ readonly scope: 'schema' | 'database';
857
+ }
858
+ /**
859
+ * Construct the one parent shape used by ledger-bearing child addresses.
654
860
  *
655
- * The derived plan shape is expected to satisfy these relational invariants,
656
- * which are beyond structural typing:
657
- * - Every ApplyGuard.appliesTo and ProofObligation.appliesTo matches exactly one PhysicalOperation.ref in the same step/fragment (no dangling or duplicate ref).
658
- * - Every external-ddl-exclusion binding's AssumptionId is present in the step's restsOnAssumptions closure and in GuardedPlan.assumptions.
659
- * - Journal record stepIds are consistent with intent.stepId; ApplyResult.observations is a superset of every ObservedOutcomeRecord.observations.
861
+ * A parent identifies containment only. Ledger scope belongs to the child
862
+ * address, while a catalogue identity is an observed, non-address fact. Keep
863
+ * both out of this recursive serialization so every producer names a physical
864
+ * child the same way.
865
+ */
866
+ declare function canonicalResourceParent(address: ResourceAddress): ResourceAddress;
867
+ /**
868
+ * The sole structural equality for a ledger address. Parent absence is
869
+ * canonicalized so `undefined` and `null` mean the same root address.
870
+ */
871
+ declare function sameLedgerAddress(left: LedgerAddress, right: LedgerAddress): boolean;
872
+ /** A canonical map key with the same key-order-insensitive parent semantics. */
873
+ declare function ledgerAddressKey(address: LedgerAddress): string;
874
+ /**
875
+ * Canonical parent representation for PostgreSQL's `address_parent` column.
876
+ * Catalogue observations never create another physical ledger address.
877
+ */
878
+ declare function ledgerAddressParentJson(address: LedgerAddress): string;
879
+ interface LedgerPayload {
880
+ readonly value: JsonValue;
881
+ readonly digest: string;
882
+ }
883
+ /**
884
+ * The durable, operator-facing explanation attached to a `refused` terminal.
885
+ * The address itself remains in the event's canonical address columns; these
886
+ * values preserve the other facts needed to explain a historic refusal.
887
+ */
888
+ interface LedgerRefusal {
889
+ /** Closed durable vocabulary; stored strings are validated at the reader. */
890
+ readonly code: RefusalCode;
891
+ readonly cause: string;
892
+ readonly state: 'unknown' | 'managed' | 'absent';
893
+ readonly withheldAuthority: string;
894
+ readonly resolvingCommand: string;
895
+ }
896
+ interface LedgerChainMember {
897
+ readonly eventId: string;
898
+ readonly executionId?: string;
899
+ readonly plannedClaimKey?: string;
900
+ readonly claimGroupId?: string;
901
+ readonly rootClaimId?: string;
902
+ readonly address: LedgerAddress;
903
+ readonly catalogueIdentity?: CatalogueIdentity;
904
+ readonly eventKind: LedgerEventKind;
905
+ readonly predecessor?: string;
906
+ readonly pairId?: string;
907
+ readonly declared?: LedgerPayload;
908
+ readonly observed?: LedgerPayload;
909
+ /** Present exactly on a durable `refused` terminal. */
910
+ readonly refusal?: LedgerRefusal;
911
+ readonly controller: string;
912
+ /** The durable OID paired with `controller` when the event was recorded. */
913
+ readonly controllerOid?: string;
914
+ readonly recordedAt?: string;
915
+ }
916
+ /** A durable effects-closure reservation, anchored in its root claim's ledger. */
917
+ interface LedgerReservationRow {
918
+ readonly address: LedgerAddress;
919
+ readonly claimKind: LedgerClaimKind;
920
+ readonly executionId: string;
921
+ readonly pairId?: string;
922
+ readonly rootClaimId: string;
923
+ readonly homeLedger: LedgerHome;
924
+ }
925
+ interface LedgerHome {
926
+ readonly scope: 'schema' | 'database';
927
+ /** Present exactly for a schema ledger. */
928
+ readonly schema?: string;
929
+ }
930
+ /** The lineage facts stored beside every ledger; their admission rules ship later. */
931
+ interface LedgerIdentity {
932
+ readonly clusterSystemIdentifier: string;
933
+ readonly databaseOid: string;
934
+ readonly namespaceOid?: string;
935
+ }
936
+ interface LedgerShapeMarker {
937
+ readonly version: number;
938
+ }
939
+ /**
940
+ * The only marker vocabulary understood by the reinitialize-preflight path.
941
+ * `absent` is deliberately distinct from a malformed or old marker: a
942
+ * missing marker is how a new scope enters the cutover.
943
+ */
944
+ type LedgerMarkerState = {
945
+ readonly kind: 'current';
946
+ } | {
947
+ readonly kind: 'absent';
948
+ } | {
949
+ readonly kind: 'older';
950
+ readonly version: number;
951
+ } | {
952
+ readonly kind: 'future';
953
+ readonly version: number;
954
+ } | {
955
+ readonly kind: 'mixed';
956
+ readonly versions: readonly number[];
957
+ } | {
958
+ readonly kind: 'unreadable';
959
+ readonly reason: string;
960
+ };
961
+ /** The closed result set for one explicit reinitialize-preflight scope. */
962
+ type ReinitializePreflightScopeOutcome = 'current' | 'unchanged' | 'failed' | 'not-attempted';
963
+ 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';
964
+ /** The exact operation that produced a reported preflight failure. */
965
+ type ReinitializePreflightFailureStep = 'advisory-lock' | 'marker' | 'identity' | 'ownership-grants' | 'archive' | 'create' | 'record-identity' | 'creation-grants' | 'write-marker' | 'output';
966
+ /** PostgreSQL's unmodified message, paired with the engine step that failed. */
967
+ interface ReinitializePreflightFailureReason {
968
+ readonly step: ReinitializePreflightFailureStep;
969
+ readonly message: string;
970
+ }
971
+ interface ReinitializePreflightScopeReportBase {
972
+ readonly ledger: LedgerHome;
973
+ readonly marker: LedgerMarkerState;
974
+ readonly refusal?: {
975
+ readonly code: ReinitializePreflightRefusalCode;
976
+ readonly detail: string;
977
+ };
978
+ }
979
+ /** A failed scope is structurally required to retain its diagnostic. */
980
+ type ReinitializePreflightScopeReport = (ReinitializePreflightScopeReportBase & {
981
+ readonly outcome: 'failed';
982
+ readonly reason: ReinitializePreflightFailureReason;
983
+ }) | (ReinitializePreflightScopeReportBase & {
984
+ readonly outcome: Exclude<ReinitializePreflightScopeOutcome, 'failed'>;
985
+ readonly reason?: never;
986
+ });
987
+ /** A current DSL declaration for which no chain exists in its home ledger. */
988
+ interface ReinitializePreflightAdoptionCandidate {
989
+ readonly address: LedgerAddress;
990
+ readonly declaration: LedgerPayload;
991
+ }
992
+ interface ReinitializePreflightReport {
993
+ readonly scopes: readonly ReinitializePreflightScopeReport[];
994
+ readonly adoptionCandidates: readonly ReinitializePreflightAdoptionCandidate[];
995
+ }
996
+
997
+ /** The only durable management states an address can have. */
998
+ type LedgerStableState = 'unknown' | 'managed' | 'absent';
999
+ /** A claim is open until its own grammar column closes it. */
1000
+ interface LedgerOpenClaim {
1001
+ readonly event: LedgerChainMember;
1002
+ readonly kind: LedgerClaimKind;
1003
+ readonly stableStateBeforeClaim: LedgerStableState;
1004
+ readonly phase: 'claimed' | 'executing' | 'indeterminate';
1005
+ }
1006
+ /** What readers present: stable state plus any still-open claim. */
1007
+ type LedgerReportedState = {
1008
+ readonly kind: LedgerStableState;
1009
+ } | {
1010
+ readonly kind: 'pending';
1011
+ readonly stableState: LedgerStableState;
1012
+ readonly claim: LedgerOpenClaim;
1013
+ } | {
1014
+ readonly kind: 'blocked';
1015
+ readonly stableState: LedgerStableState;
1016
+ readonly claim: LedgerOpenClaim;
1017
+ };
1018
+ /** The legal lifecycle grammar is deliberately a closed, per-claim matrix. */
1019
+ interface LedgerLifecycleGrammarColumn {
1020
+ readonly claimKind: LedgerClaimKind;
1021
+ readonly opensFrom: readonly LedgerStableState[];
1022
+ readonly resolvesThrough: readonly LedgerEventKind[];
1023
+ }
1024
+ interface ProjectedLedgerChain {
1025
+ readonly kind: 'projected-ledger-chain';
1026
+ readonly ledger: LedgerHome;
1027
+ readonly address: LedgerAddress;
1028
+ readonly events: readonly LedgerChainMember[];
1029
+ readonly stableState: LedgerStableState;
1030
+ readonly openClaim?: LedgerOpenClaim;
1031
+ readonly reportedState: LedgerReportedState;
1032
+ /** The last declaration fact recorded by a claim chain, if any. */
1033
+ readonly declaration?: LedgerPayload;
1034
+ /** The last read-back recorded by a claim chain, if any. */
1035
+ readonly observation?: LedgerPayload;
1036
+ }
1037
+ type UnprojectableChainReason = {
1038
+ readonly code: 'cycle';
1039
+ readonly eventIds: readonly string[];
1040
+ } | {
1041
+ readonly code: 'missing-predecessor';
1042
+ readonly eventId: string;
1043
+ readonly predecessor: string;
1044
+ } | {
1045
+ readonly code: 'fork';
1046
+ readonly predecessor?: string;
1047
+ readonly eventIds: readonly string[];
1048
+ } | {
1049
+ readonly code: 'unknown-event-kind';
1050
+ readonly eventId: string;
1051
+ readonly eventKind: string;
1052
+ } | {
1053
+ readonly code: 'address-mismatch';
1054
+ readonly eventId: string;
1055
+ } | {
1056
+ readonly code: 'duplicate-event-id';
1057
+ readonly eventId: string;
1058
+ } | {
1059
+ readonly code: 'invalid-lifecycle-edge';
1060
+ readonly eventId: string;
1061
+ readonly detail: string;
1062
+ };
1063
+ /**
1064
+ * A degraded read is data, not an exception. Its required reason lets every
1065
+ * mutation fail closed while inspect-like readers can still display the chain.
1066
+ */
1067
+ interface UnprojectableLedgerChain {
1068
+ readonly kind: 'unprojectable-ledger-chain';
1069
+ readonly ledger: LedgerHome;
1070
+ readonly address: LedgerAddress;
1071
+ readonly events: readonly LedgerChainMember[];
1072
+ readonly reason: UnprojectableChainReason;
1073
+ readonly codeVersion: 1;
1074
+ }
1075
+ type LedgerChainProjection = ProjectedLedgerChain | UnprojectableLedgerChain;
1076
+
1077
+ /** A planned managed statement has a stable position inside its claim bundle. */
1078
+ interface ClaimBundleStatement {
1079
+ readonly ordinal: number;
1080
+ readonly sql: string;
1081
+ }
1082
+ /**
1083
+ * The complete ordered set of statements a claim may execute. It is supplied
1084
+ * by planning and never extended by the execution path.
1085
+ */
1086
+ interface ClaimStatementBundle {
1087
+ readonly statements: readonly ClaimBundleStatement[];
1088
+ }
1089
+ /** A cascade-covered claim records a member fact but never executes SQL. */
1090
+ interface EmptyClaimStatementBundle {
1091
+ readonly statements: readonly [];
1092
+ }
1093
+ /**
1094
+ * Opaque capability minted only by the core claim-admission boundary.
1095
+ * Its members are intentionally not public: adapters present it to core rather
1096
+ * than reconstructing a claim identity from data controlled by a caller.
1097
+ */
1098
+ declare const claimTokenBrand: unique symbol;
1099
+ interface ClaimToken {
1100
+ readonly [claimTokenBrand]: 'dbsp-outcome-claim-token';
1101
+ }
1102
+ /**
1103
+ * Opaque execution authority minted only after an adapter has admitted a live
1104
+ * operation. It deliberately has no structural fields a caller can supply.
1105
+ */
1106
+ declare const admittedPermitBrand: unique symbol;
1107
+ interface AdmittedPermit {
1108
+ readonly [admittedPermitBrand]: 'dbsp-admitted-permit';
1109
+ }
1110
+ /** Fields shared by every fixed plan-time outcome claim. */
1111
+ interface OutcomeClaimPlanBase {
1112
+ readonly claimId: string;
1113
+ /** One actual apply attempt; deliberately distinct from the persisted run id. */
1114
+ readonly executionId?: string;
1115
+ /** Digest-covered logical position of this claim in the reviewed plan. */
1116
+ readonly plannedClaimKey?: string;
1117
+ /** The atomic closure identity; a single-address claim uses its root claim id. */
1118
+ readonly claimGroupId?: string;
1119
+ readonly address: LedgerAddress;
1120
+ readonly claimKind: LedgerClaimKind;
1121
+ /**
1122
+ * A creation verifies that its target address remains vacant before DDL.
1123
+ * Absent only on plans written before this material was introduced.
1124
+ */
1125
+ readonly requiresVacancy?: boolean;
1126
+ readonly declared?: LedgerPayload;
1127
+ readonly pairId?: string;
1128
+ }
1129
+ /** A claim that owns a manifest-bound SQL bundle. */
1130
+ interface SqlBearingOutcomeClaimPlan extends OutcomeClaimPlanBase {
1131
+ readonly claimSpecies: 'sql-bearing';
1132
+ readonly rootClaimId?: string;
1133
+ readonly statementBundle: ClaimStatementBundle;
1134
+ }
1135
+ /** Adoption records a present live object but deliberately sends no SQL. */
1136
+ interface AdoptionOutcomeClaimPlan extends OutcomeClaimPlanBase {
1137
+ readonly claimSpecies: 'adoption';
1138
+ readonly rootClaimId?: string;
1139
+ readonly claimKind: 'adopt-intent';
1140
+ readonly statementBundle: EmptyClaimStatementBundle;
1141
+ }
1142
+ /** A closure member whose terminal fact is covered by its root claim's SQL. */
1143
+ interface CascadeCoveredOutcomeClaimPlan extends OutcomeClaimPlanBase {
1144
+ readonly claimSpecies: 'cascade-covered';
1145
+ /** The SQL-bearing destructive root that covers this member. */
1146
+ readonly rootClaimId: string;
1147
+ readonly statementBundle: EmptyClaimStatementBundle;
1148
+ }
1149
+ /** The fixed plan-time material that becomes one ledger claim. */
1150
+ type OutcomeClaimPlan = SqlBearingOutcomeClaimPlan | AdoptionOutcomeClaimPlan | CascadeCoveredOutcomeClaimPlan;
1151
+ /** The only successful result of admission, including its single-use token. */
1152
+ interface AdmittedOutcomeClaim {
1153
+ readonly kind: 'admitted-outcome-claim';
1154
+ readonly plan: OutcomeClaimPlan;
1155
+ readonly stableStateBeforeClaim: LedgerStableState;
1156
+ readonly token: ClaimToken;
1157
+ }
1158
+ /** Every refusal retains the subject's server or admission words. */
1159
+ interface OutcomeProtocolRefusal {
1160
+ readonly kind: 'outcome-protocol-refused';
1161
+ readonly reason: string;
1162
+ }
1163
+ type OutcomeClaimAdmission = AdmittedOutcomeClaim | OutcomeProtocolRefusal;
1164
+ /** A typed live-vacancy result supplied by the catalogue-specific reader. */
1165
+ type OutcomeVacancy = {
1166
+ readonly kind: 'vacant';
1167
+ } | {
1168
+ readonly kind: 'occupied';
1169
+ readonly reason: string;
1170
+ };
1171
+ /** A projected chain is always supplied to core admission as one unit. */
1172
+ interface OutcomeClaimAdmissionInput {
1173
+ readonly plan: OutcomeClaimPlan;
1174
+ readonly projection: LedgerChainProjection;
1175
+ /** Current role read by the adapter on the locked claiming session. */
1176
+ readonly currentController?: ControllerIdentity;
1177
+ /** Fresh locked catalogue identity for an existing managed address. */
1178
+ readonly liveAddress?: LedgerAddress;
1179
+ }
1180
+ /** Typed catalogue evidence used by outcome-protocol recovery. */
1181
+ type OutcomeRecoveryEffect = 'applied' | 'no-effect' | 'unverifiable';
1182
+ type OutcomeRecoveryReadBack = {
1183
+ readonly kind: 'absent';
1184
+ readonly effect?: OutcomeRecoveryEffect;
1185
+ } | {
1186
+ readonly kind: 'present';
1187
+ readonly catalogueIdentity: CatalogueIdentity;
1188
+ /** The canonical shape read from the live catalogue. */
1189
+ readonly observed: LedgerPayload;
1190
+ /** Operation-specific read-back when the catalogue presence is insufficient. */
1191
+ readonly effect?: OutcomeRecoveryEffect;
1192
+ };
1193
+ /** A failed read is evidence of nothing, and therefore permits no append. */
1194
+ interface OutcomeCatalogueUnavailable {
1195
+ readonly kind: 'catalogue-unavailable';
1196
+ readonly reason: string;
1197
+ }
1198
+ type OutcomeRecoveryCatalogueRead = OutcomeRecoveryReadBack | OutcomeCatalogueUnavailable;
1199
+ /** The catalogue boundary is injected so core has no database dependency. */
1200
+ type OutcomeRecoveryCatalogueReader = (address: LedgerAddress) => Promise<OutcomeRecoveryCatalogueRead>;
1201
+ /** A recovery append has one canonical predecessor/payload comparison shape. */
1202
+ interface OutcomeRecoveryResolution {
1203
+ readonly eventKind: 'refused' | 'observed' | 'absent' | 'indeterminate' | 'resolved';
1204
+ readonly predecessor: string;
1205
+ readonly rootClaimId: string;
1206
+ readonly reason: string;
1207
+ readonly readBack: OutcomeRecoveryReadBack;
1208
+ /** Present exactly when recovery closes the open claim as refused. */
1209
+ readonly refusal?: LedgerRefusal;
1210
+ }
1211
+ type OutcomeRecoveryClassification = {
1212
+ readonly kind: 'outcome-recovery-append';
1213
+ readonly address: LedgerAddress;
1214
+ readonly resolution: OutcomeRecoveryResolution;
1215
+ } | {
1216
+ readonly kind: 'outcome-recovery-pending';
1217
+ readonly address: LedgerAddress;
1218
+ readonly reason: string;
1219
+ /** A catalogue failure is a named pre-append refusal, not a retry hint. */
1220
+ readonly reasonCode?: 'catalogue-unavailable';
1221
+ } | {
1222
+ readonly kind: 'outcome-recovery-blocked';
1223
+ readonly address: LedgerAddress;
1224
+ readonly reason: string;
1225
+ } | {
1226
+ readonly kind: 'outcome-recovery-no-open-claim';
1227
+ readonly address: LedgerAddress;
1228
+ } | {
1229
+ readonly kind: 'outcome-recovery-malformed-chain';
1230
+ readonly address: LedgerAddress;
1231
+ readonly reason: string;
1232
+ };
1233
+ /**
1234
+ * Claim-bound evidence required before an interrupted creation or modification
1235
+ * can be attributed to DBSP. The adapter reconstructs these values from the
1236
+ * durable run, admitted operation and scoped authorization while holding its
1237
+ * run and ledger locks; a same-name catalogue object is never this evidence.
660
1238
  */
1239
+ interface OutcomeIndeterminateRecoveryEvidence {
1240
+ readonly runId: string;
1241
+ readonly planDigest: string;
1242
+ readonly executionId: string;
1243
+ readonly claimId: string;
1244
+ readonly plannedClaimKey?: string;
1245
+ /** Digest recorded when the exact admitted statement bundle was minted. */
1246
+ readonly admittedBundleDigest: string;
1247
+ /** Digest re-read from the persisted operation at resolution time. */
1248
+ readonly persistedBundleDigest: string;
1249
+ readonly recordedPreState: 'unknown' | 'managed' | 'absent';
1250
+ readonly externalDdlExclusion: {
1251
+ readonly planDigest: string;
1252
+ readonly address: LedgerAddress;
1253
+ readonly trustRoot: string;
1254
+ };
1255
+ }
1256
+ interface OutcomeRecoveryInput {
1257
+ readonly projection: LedgerChainProjection;
1258
+ readonly catalogue: OutcomeRecoveryCatalogueReader;
1259
+ /** Accepted with the interrupted run, never inferred from a current policy. */
1260
+ readonly acceptedExternalDdlExclusion: boolean;
1261
+ /** Required for resolving an indeterminate creation or modification. */
1262
+ readonly indeterminateEvidence?: OutcomeIndeterminateRecoveryEvidence;
1263
+ /** Only an explicit reconciliation path may close an indeterminate claim. */
1264
+ readonly resolveIndeterminate?: boolean;
1265
+ }
661
1266
 
1267
+ /**
1268
+ * The generator and recorded transition planner share this immutable execution
1269
+ * vocabulary. It intentionally does not reuse GuardedPlanStep: generated DDL
1270
+ * has no transition-operation graph or fingerprint protocol, but it must carry
1271
+ * the complete claim, SQL, selection, and replay contract before it is shown.
1272
+ */
1273
+ type ManagedStepClassification = 'non-destructive' | 'removal' | 'data-destructive' | 'paired-readdress';
1274
+ type ManagedStepReplayPolicy = 'recorded' | 'fresh-live-only';
1275
+ interface ManagedStepClosureMember {
1276
+ readonly plannedClaimKey: string;
1277
+ readonly address: DeclarableResourceAddress & {
1278
+ readonly scope: 'schema' | 'database';
1279
+ };
1280
+ }
1281
+ interface ManagedStepSelectionRequirement {
1282
+ readonly kind: 'replacement' | 'adoption' | 'readdress' | 'optional-action';
1283
+ readonly selector: string;
1284
+ }
1285
+ /**
1286
+ * Reviewed lifecycle material. It lives beside the claim and SQL in the
1287
+ * normalized manifest; generator provenance is never an execution source.
1288
+ */
1289
+ type ManagedStepLifecycle = {
1290
+ readonly kind: 'adoption';
1291
+ readonly shape: TableIR;
1292
+ } | {
1293
+ readonly kind: 'adoption-refused';
1294
+ } | {
1295
+ readonly kind: 'readdress';
1296
+ readonly declaration: TableReaddressDeclaration;
1297
+ };
1298
+ /** A digest-covered, ordered unit of managed DDL. */
1299
+ interface NormalizedManagedStep {
1300
+ readonly stepKey: string;
1301
+ readonly order: number;
1302
+ readonly segmentId: string;
1303
+ readonly dependencyOrder: readonly string[];
1304
+ /** Root address, unless the operation declares a destructive closure root. */
1305
+ readonly address?: DeclarableResourceAddress & {
1306
+ readonly scope: 'schema' | 'database';
1307
+ };
1308
+ readonly closure?: {
1309
+ readonly root: DeclarableResourceAddress & {
1310
+ readonly scope: 'schema' | 'database';
1311
+ };
1312
+ readonly members: readonly ManagedStepClosureMember[];
1313
+ };
1314
+ readonly claimKind: LedgerClaimKind;
1315
+ readonly plannedClaimKeys: readonly string[];
1316
+ readonly statementBundle: ClaimStatementBundle;
1317
+ readonly classification: ManagedStepClassification;
1318
+ readonly requiresVacancy: boolean;
1319
+ readonly expectedDeclaration?: LedgerPayload;
1320
+ readonly expectedCatalogueIdentity?: CatalogueIdentity;
1321
+ readonly selection?: ManagedStepSelectionRequirement;
1322
+ readonly lifecycle?: ManagedStepLifecycle;
1323
+ readonly replayPolicy: ManagedStepReplayPolicy;
1324
+ }
1325
+ /**
1326
+ * Immutable managed-outcome material carried by a plan step. It is produced
1327
+ * while proving, covered by the plan digest, and is the only source an
1328
+ * executor may use for the address or statement bundle of a managed claim.
1329
+ */
1330
+ interface ManagedStepClaimMaterial {
1331
+ /** Legacy plan-local label retained for serialized-plan compatibility; never a ledger event id. */
1332
+ readonly claimId: string;
1333
+ /** Stable only inside this persisted plan; execution mints the claim id. */
1334
+ readonly plannedClaimKey: string;
1335
+ readonly address: DeclarableResourceAddress & {
1336
+ readonly scope: 'schema' | 'database';
1337
+ };
1338
+ readonly claimKind: LedgerClaimKind;
1339
+ readonly statementBundle: ClaimStatementBundle;
1340
+ /** True only when the plan writes an address it did not read. */
1341
+ readonly requiresVacancy: boolean;
1342
+ }
662
1343
  interface ExecutableAssertion {
663
1344
  readonly proposition: Proposition;
664
1345
  readonly scope: readonly ResourceAddress[];
@@ -666,6 +1347,8 @@ interface ExecutableAssertion {
666
1347
  interface DurableIntentRecord {
667
1348
  readonly runId?: string;
668
1349
  readonly run?: TransitionRunMetadata;
1350
+ /** One apply attempt, deliberately distinct from the durable reviewed run. */
1351
+ readonly executionId?: string;
669
1352
  readonly stepId: string;
670
1353
  readonly operation: PhysicalOperation;
671
1354
  readonly recordedAt: string;
@@ -688,6 +1371,8 @@ interface TransitionRunMetadata {
688
1371
  readonly databaseId: string;
689
1372
  readonly coreVersion: string;
690
1373
  readonly startedAt: string;
1374
+ /** Generator removal runs are inspectable but must be freshly re-planned. */
1375
+ readonly replayability?: 'replayable' | 'non-replayable-generator-removal';
691
1376
  }
692
1377
  type TransitionJournalEventName = 'intent' | 'completion' | 'observed';
693
1378
  type TransitionJournalEventRecord = DurableIntentRecord | TransactionalCompletionRecord | StepJournal;
@@ -704,6 +1389,24 @@ interface TransitionJournalEvent {
704
1389
  interface TransitionRunJournal {
705
1390
  readonly run: TransitionRunMetadata;
706
1391
  readonly events: readonly TransitionJournalEvent[];
1392
+ /** Run-level approval records are deliberately not step attempts. */
1393
+ readonly authorizations?: readonly TransitionRunAuthorization[];
1394
+ }
1395
+ /**
1396
+ * The audit record made before a durable plan may begin execution. Keeping it
1397
+ * outside the step event stream means a crash after authorization is retryable:
1398
+ * pristine means no intent, completion, or observed step event.
1399
+ */
1400
+ interface TransitionRunAuthorization {
1401
+ readonly runId: string;
1402
+ readonly policy: readonly AssumptionAcceptance[];
1403
+ readonly grants: readonly {
1404
+ readonly assumptionId: string;
1405
+ readonly grant: number;
1406
+ }[];
1407
+ readonly digest: string;
1408
+ readonly actor: string;
1409
+ readonly authorizedAt: string;
707
1410
  }
708
1411
  type StepOutcome = 'completed' | 'guard-failed' | 'guard-timeout' | 'context-mismatch' | 'operation-failed-not-applied' | 'partially-applied' | 'unknown-step-result';
709
1412
  interface StepJournalBase {
@@ -743,6 +1446,8 @@ interface GuardedPlanStep {
743
1446
  readonly guards: readonly ApplyGuard[];
744
1447
  readonly restsOnAssumptions: readonly AssumptionId[];
745
1448
  readonly selectionRationale: RuleSelectionRationale;
1449
+ /** Present exactly for a managed DDL operation with a fixed plan-time sink. */
1450
+ readonly managedClaim?: ManagedStepClaimMaterial;
746
1451
  }
747
1452
  interface GuardedPlanSegment {
748
1453
  readonly segmentId: string;
@@ -759,6 +1464,12 @@ interface GuardedPlan {
759
1464
  readonly segments: readonly GuardedPlanSegment[];
760
1465
  readonly steps: readonly GuardedPlanStep[];
761
1466
  readonly postconditions: readonly ExecutableAssertion[];
1467
+ /**
1468
+ * Present on plans emitted by current `dbsp plan`. It remains optional in
1469
+ * the TypeScript shape solely so recovery can read historic documents; new
1470
+ * execution rejects an absent contract before taking intent.
1471
+ */
1472
+ readonly executionContract?: ExecutionContract;
762
1473
  }
763
1474
  type ProvenGuardProtocol = Exclude<GuardProtocol, {
764
1475
  readonly kind: 'impossible';
@@ -771,6 +1482,11 @@ interface ProvenPlanStep extends Omit<GuardedPlanStep, 'guards'> {
771
1482
  }
772
1483
  interface ProvenPlanShape extends Omit<GuardedPlan, 'steps'> {
773
1484
  readonly steps: readonly ProvenPlanStep[];
1485
+ /**
1486
+ * Present on newly persisted declarative runs. It is inside the plan document
1487
+ * deliberately: the plan digest therefore covers the declaration set.
1488
+ */
1489
+ readonly declarations?: DeclarationSet;
774
1490
  }
775
1491
  /**
776
1492
  * Plain serializable audit/dump format. A future
@@ -779,6 +1495,10 @@ interface ProvenPlanShape extends Omit<GuardedPlan, 'steps'> {
779
1495
  */
780
1496
  type SerializedProvenPlan = ProvenPlanShape;
781
1497
 
1498
+ /** Stable phase-owned result of a durable apply attempt. */
1499
+ 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';
1500
+ /** Stable phase-owned result of recovery classification. */
1501
+ 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';
782
1502
  interface ApplyResult {
783
1503
  readonly assessment: PlanAssessment;
784
1504
  readonly journals: readonly StepJournal[];
@@ -788,6 +1508,19 @@ interface ApplyResult {
788
1508
  readonly protocol: ProvenGuardProtocol['kind'];
789
1509
  readonly artefact: RecoveryArtefact;
790
1510
  }[];
1511
+ /** Present only on the durable-apply entry point. */
1512
+ readonly durableOutcome?: DurableApplyOutcome;
1513
+ /** Present only on the recovery entry point. */
1514
+ readonly recoveryOutcome?: RecoveryOutcome;
1515
+ /** An admitted managed claim remains unresolved and must not be retried. */
1516
+ readonly unresolvedOutcome?: {
1517
+ readonly kind: 'recovery-required';
1518
+ readonly claimId: string;
1519
+ readonly detail: string;
1520
+ } | {
1521
+ readonly kind: 'transport-ambiguous';
1522
+ readonly detail: string;
1523
+ };
791
1524
  }
792
1525
 
793
1526
  type EvidenceClaimConclusion = 'established' | 'undischarged' | 'refuted' | 'conflicted';
@@ -900,6 +1633,15 @@ interface TransitionSessionClient {
900
1633
  }
901
1634
  interface TransitionQueryClient {
902
1635
  query(sql: string, params?: unknown): Promise<TransitionQueryResult>;
1636
+ /**
1637
+ * Execute a statement contributed by a plan operation.
1638
+ *
1639
+ * This is intentionally a separate, optional channel rather than a SQL
1640
+ * classifier. Core only routes the client it gives to executeOperation()
1641
+ * through it; adapter-owned preflight, journalling, and cleanup continue to
1642
+ * use query().
1643
+ */
1644
+ queryPlanOperation?(sql: string, params?: unknown): Promise<TransitionQueryResult>;
903
1645
  release(error?: unknown): void;
904
1646
  }
905
1647
  declare const transitionLessorTypeBrand: unique symbol;
@@ -917,6 +1659,19 @@ interface TransitionLessor {
917
1659
  */
918
1660
  readonly acquire: () => Promise<TransitionQueryClient>;
919
1661
  }
1662
+ declare const exclusiveTransitionTargetTypeBrand: unique symbol;
1663
+ /**
1664
+ * A callback-scoped target for durable execution.
1665
+ *
1666
+ * Adapters mint this only after they have acquired their exclusive backend
1667
+ * lease. Its representation deliberately has no public members: core is the
1668
+ * only package that can turn it back into a query lease. This is a nominal
1669
+ * accidental-misuse guard, not a security boundary against code which imports
1670
+ * core's public factory deliberately.
1671
+ */
1672
+ interface ExclusiveTransitionTarget {
1673
+ readonly [exclusiveTransitionTargetTypeBrand]: never;
1674
+ }
920
1675
  interface OperationEffectAssessment {
921
1676
  readonly effects: OperationEffects;
922
1677
  readonly restsOn: readonly Assumption[];
@@ -1049,13 +1804,56 @@ interface Comparator {
1049
1804
  compare(desired: ModelIR, current: ModelIR, context?: EquivalenceContext): CompareOutcome;
1050
1805
  }
1051
1806
 
1052
- interface AssumptionAcceptance {
1053
- readonly class: string;
1054
- readonly fromTrustRoot?: TrustRoot;
1055
- readonly withinScope?: readonly ResourceSelector[];
1807
+ /** The two destructive effects defined by the managed-ledger authority table. */
1808
+ type DestructiveAction = {
1809
+ readonly kind: 'removal';
1810
+ readonly address: LedgerAddress;
1811
+ /** Digest of the exact cascade set admitted under the ledger locks. */
1812
+ readonly closureDigest?: string;
1813
+ } | {
1814
+ readonly kind: 'data-destructive';
1815
+ readonly address: LedgerAddress;
1816
+ };
1817
+ type DeclarationDestructiveOutcome = 'requires-removal' | 'requires-lossy-change' | 'replacement-requested-by-plan' | 'requires-neither' | 'absent' | 'uncomputable';
1818
+ type OwnershipDestructiveOutcome = 'managed-by-me' | 'managed-by-other' | 'pending' | 'blocked' | 'unknown' | 'uncomputable';
1819
+ type CatalogueIdentityDestructiveOutcome = 'matches-recorded' | 'differs' | 'object-absent' | 'catalogue-unavailable';
1820
+ type OperatorAcceptanceDestructiveOutcome = 'destructive-plan-accepted' | 'absent';
1821
+ type ContainmentClosureDestructiveOutcome = 'all-contained-or-managed' | 'reaches-unmanaged' | 'undecidable';
1822
+ type LedgerLineageDestructiveOutcome = 'matches-database' | 'differs' | 'unreadable';
1823
+ /** Closed evidence supplied to the sole destructive-decision interpreter. */
1824
+ interface DestructiveAuthorityEvidence {
1825
+ readonly declaration: DeclarationDestructiveOutcome;
1826
+ /** Present only for replacement-requested-by-plan; it limits that permit. */
1827
+ readonly replacementAddress?: LedgerAddress;
1828
+ readonly ownership: OwnershipDestructiveOutcome;
1829
+ readonly catalogueIdentity: CatalogueIdentityDestructiveOutcome;
1830
+ readonly operatorAcceptance: OperatorAcceptanceDestructiveOutcome;
1831
+ /** Required only for removals. */
1832
+ readonly containment?: ContainmentClosureDestructiveOutcome;
1833
+ /** The exact live cascade member that made `reaches-unmanaged` refuse. */
1834
+ readonly containmentUnmanaged?: LedgerAddress;
1835
+ /** The live catalogue error that made containment undecidable. */
1836
+ readonly containmentReason?: string;
1837
+ readonly ledgerLineage: LedgerLineageDestructiveOutcome;
1838
+ }
1839
+ declare const destructiveAuthorityPermitBrand: unique symbol;
1840
+ /**
1841
+ * Opaque positive evidence. It has no constructible fields, so an execution
1842
+ * sink can require it without accepting a caller-assembled set of booleans.
1843
+ */
1844
+ interface DestructiveAuthorityPermit {
1845
+ readonly [destructiveAuthorityPermitBrand]: 'dbsp-destructive-authority-permit';
1056
1846
  }
1057
- interface ApplyPolicy {
1058
- readonly accepts: readonly AssumptionAcceptance[];
1847
+ interface PermittedDestructiveDecision {
1848
+ readonly kind: 'destructive-decision-permitted';
1849
+ readonly action: DestructiveAction;
1850
+ readonly permit: DestructiveAuthorityPermit;
1851
+ }
1852
+ interface RefusedDestructiveDecision {
1853
+ readonly kind: 'destructive-decision-refused';
1854
+ readonly action: DestructiveAction;
1855
+ readonly reasons: readonly string[];
1059
1856
  }
1857
+ type DestructiveDecision = PermittedDestructiveDecision | RefusedDestructiveDecision;
1060
1858
 
1061
- 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, EdgeTableTraversal, type EquivalenceCapability, type EquivalenceContext, type EquivalenceResult, type EvidenceClaimConclusion, type EvidenceClaimResult, type EvidenceId, type EvidenceObservation, type EvidenceObservationFilters, type EvidenceView, type ExecutableAssertion, 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 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 };
1859
+ export { AdjacencyTraversal, type AdmittedOutcomeClaim, type AdmittedPermit, type AdoptionOutcomeClaimPlan, 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 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 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 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, 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, 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 };