> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Module: computations

> Typed computation inputs and accepted-result locators.

Typed computation inputs and accepted-result locators. Native owners retain
execution, authority, acceptance and retention.

## Classes

* [InputBasisConflict](/api/classes/computations.InputBasisConflict)

## Interfaces

* [InputCustody](/api/interfaces/computations.InputCustody)

## References

### ResultRef

Re-exports [ResultRef](/api/modules/requests#resultref)

***

### InputBasis

Re-exports [InputBasis](/api/modules/requests#inputbasis)

***

### composeComputationBasis

Re-exports [composeComputationBasis](/api/modules/requests#composecomputationbasis)

***

### validateComputationBasis

Re-exports [validateComputationBasis](/api/modules/requests#validatecomputationbasis)

***

### validateResultDescription

Re-exports [validateResultDescription](/api/modules/requests#validateresultdescription)

***

### Availability

Re-exports [Availability](/api/modules/requests#availability)

***

### DefinitionRef

Re-exports [DefinitionRef](/api/modules/requests#definitionref)

***

### BindingRef

Re-exports [BindingRef](/api/modules/requests#bindingref)

***

### ComputationBasis

Re-exports [ComputationBasis](/api/modules/requests#computationbasis)

***

### BasisRef

Re-exports [BasisRef](/api/modules/requests#basisref)

***

### ResultPlacement

Re-exports [ResultPlacement](/api/modules/requests#resultplacement)

***

### ProducerEvidence

Re-exports [ProducerEvidence](/api/modules/requests#producerevidence)

***

### ResultDescription

Re-exports [ResultDescription](/api/modules/requests#resultdescription)

***

### ResolvedInput

Re-exports [ResolvedInput](/api/modules/requests#resolvedinput)

***

### InputClaim

Re-exports [InputClaim](/api/modules/requests#inputclaim)

***

### describeInputBasis

Re-exports [describeInputBasis](/api/modules/requests#describeinputbasis)

## Type Aliases

### FixedBasis

Ƭ **FixedBasis**: `Extract`\<[`InputBasis`](/api/modules/requests#inputbasis), \{ `kind`: `"local"` | `"dataset_snapshots"`  }>

Not exported: an exported type refers to it.

***

### BasisConsistency

Ƭ **BasisConsistency**: \{ `kind`: `"observed"`  } | \{ `kind`: `"fixed"` ; `basis`: [`FixedBasis`](/api/modules/computations#fixedbasis) | `null`  } | \{ `kind`: `"snapshot"` ; `basis`: `Extract`\<[`FixedBasis`](/api/modules/computations#fixedbasis), \{ `kind`: `"local"`  }> | `null`  }

***

### InputDependency

Ƭ **InputDependency**: `Object`

Exact dependency coordinates. They convey neither read nor disclosure authority.

#### Type declaration

| Name | Type |
| :- | :- |
| `owner` | `string` |
| `reference` | `string` |
| `version` | `string` |
| `digest` | `string` |

***

### ReferenceFields

Ƭ **ReferenceFields**: `Record`\<`string`, [`GenericValidator`](/api/modules/values#genericvalidator) & \{ `type`: [`ResultRef`](/api/modules/requests#resultref)\<`any`>  }>

Not exported: an exported type refers to it.

***

### InputBasisDefinition

Ƭ **InputBasisDefinition**: `ReturnType`\<typeof [`defineInputBasis`](/api/modules/computations#defineinputbasis)>

***

### EvaluationRef

Ƭ **EvaluationRef**: `Object`

#### Type declaration

| Name | Type |
| :- | :- |
| `owner` | `string` |
| `reference` | `string` |

***

### QueryCtx

Ƭ **QueryCtx**: [`GenericQueryCtx`](/api/interfaces/server.GenericQueryCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>

Not exported: an exported type refers to it.

***

### MutationCtx

Ƭ **MutationCtx**: [`GenericMutationCtx`](/api/interfaces/server.GenericMutationCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>

Not exported: an exported type refers to it.

***

### ComputationOwner

Ƭ **ComputationOwner**\<`ReadContext`, `WriteContext`>: `Object`

Semantic owners retain their own payloads and receipts. Calls always run
under the actual current principal; receipt strings grant no authority.

#### Type parameters

| Name | Type |
| :- | :- |
| `ReadContext` | [`QueryCtx`](/api/modules/computations#queryctx) |
| `WriteContext` | [`MutationCtx`](/api/modules/computations#mutationctx) |

#### Type declaration

| Name | Type |
| :- | :- |
| `acquire` | (`ctx`: `WriteContext`, `reference`: [`ResultRef`](/api/modules/requests#resultref)\<`any`>, `demand`: \{ `holder`: `string` ; `expiresAt`: `string`  }) => `Promise`\<\{ `description`: [`ResultDescription`](/api/modules/requests#resultdescription)\<`any`> ; `receipt`: [`Value`](/api/modules/values#value)  }> |
| `check` | (`ctx`: `ReadContext`, `reference`: [`ResultRef`](/api/modules/requests#resultref)\<`any`>, `receipt`: [`Value`](/api/modules/values#value), `holder`: `string`) => `Promise`\<[`ResultDescription`](/api/modules/requests#resultdescription)\<`any`>> |
| `read` | (`ctx`: `ReadContext`, `reference`: [`ResultRef`](/api/modules/requests#resultref)\<`any`>, `receipt`: [`Value`](/api/modules/values#value), `holder`: `string`) => `Promise`\<[`Value`](/api/modules/values#value)> |
| `release` | (`ctx`: `WriteContext`, `reference`: [`ResultRef`](/api/modules/requests#resultref)\<`any`>, `receipt`: [`Value`](/api/modules/values#value), `holder`: `string`) => `Promise`\<`void`> |

***

### Q

Ƭ **Q**: [`GenericQueryCtx`](/api/interfaces/server.GenericQueryCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>

Not exported: an exported type refers to it.

***

### M

Ƭ **M**: [`GenericMutationCtx`](/api/interfaces/server.GenericMutationCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>

Not exported: an exported type refers to it.

***

### Version

Ƭ **Version**: `Object`

Not exported: an exported type refers to it.

#### Type declaration

| Name | Type |
| :- | :- |
| `kind` | `"version"` |
| `id` | `string` |
| `dataset` | `string` |
| `contract` | `string` |
| `metadata?` | [`Value`](/api/modules/values#value) |

***

### Pin

Ƭ **Pin**: `Object`

Not exported: an exported type refers to it.

#### Type declaration

| Name | Type |
| :- | :- |
| `kind` | `"pin"` |
| `id` | `string` |
| `owner` | `string` |
| `dataset` | `string` |
| `contract` | `string` |

***

### DatasetInputCustodian

Ƭ **DatasetInputCustodian**: `Object`

The installed dataset owner already implements these methods. No adapter
table, recovery journal or second pin owner is allocated.

#### Type declaration

| Name | Type |
| :- | :- |
| `version` | (`ctx`: [`Q`](/api/modules/computations#q), `dataset`: \{ `dataset`: `string` ; `contract`: `string`  }, `version`: `string`) => `Promise`\<[`Version`](/api/modules/computations#version)> |
| `acquire` | (`ctx`: [`M`](/api/modules/computations#m), `target`: [`Version`](/api/modules/computations#version), `claim`: \{ `owner`: `string` ; `name`: `string`  }) => `Promise`\<[`Pin`](/api/modules/computations#pin)> |
| `inspectInput` | (`ctx`: [`Q`](/api/modules/computations#q), `pin`: [`Pin`](/api/modules/computations#pin)) => `Promise`\<[`Version`](/api/modules/computations#version) \| `null`> |
| `release` | (`ctx`: [`M`](/api/modules/computations#m), `pin`: [`Pin`](/api/modules/computations#pin)) => `Promise`\<`void`> |

## Functions

### combineInputBases

▸ **combineInputBases**(`consistency`, `bases`): [`BasisConsistency`](/api/modules/computations#basisconsistency)

Check the guarantee supported by owner-issued input witnesses. This neither
captures inputs nor upgrades authority, retention or source consistency.

#### Parameters

| Name | Type |
| :- | :- |
| `consistency` | `"observed"` \| `"fixed"` \| `"snapshot"` |
| `bases` | readonly [`InputBasis`](/api/modules/requests#inputbasis)\[] |

#### Returns

[`BasisConsistency`](/api/modules/computations#basisconsistency)

***

### composeInputCustody

▸ **composeInputCustody**\<`ReadCtx`, `WriteCtx`>(`owners`): [`InputCustody`](/api/interfaces/computations.InputCustody)\<`ReadCtx`, `WriteCtx`>

Route references to authoritative owners. This adapter creates no records
and grants no authority. Every owner implements independent retention.

#### Type parameters

| Name |
| :- |
| `ReadCtx` |
| `WriteCtx` |

#### Parameters

| Name | Type |
| :- | :- |
| `owners` | `Record`\<`string`, [`InputCustody`](/api/interfaces/computations.InputCustody)\<`ReadCtx`, `WriteCtx`>> |

#### Returns

[`InputCustody`](/api/interfaces/computations.InputCustody)\<`ReadCtx`, `WriteCtx`>

***

### defineInputBasis

▸ **defineInputBasis**\<`Fields`>(`fields`): `Readonly`\<\{ `validator`: [`VObject`](/api/classes/values.VObject)\<[`Expand`](/api/modules/server#expand)\<\{ \[Property in string | number | symbol]?: Exclude\<Infer\<Fields\[Property]>, undefined> } & \{ \[Property in string | number | symbol]: Infer\<Fields\[Property]> }>, `Fields`, `"required"`, \{ \[Property in string | number | symbol]: Property | \`$\{Property & string}.$\{Fields\[Property]\["fieldPaths"]}\` }\[keyof `Fields`] & `string`> ; `validate`: (`value`: `unknown`) => [`Expand`](/api/modules/server#expand)\<\{ \[Property in string | number | symbol]?: Exclude\<Infer\<Fields\[Property]>, undefined> } & \{ \[Property in string | number | symbol]: Infer\<Fields\[Property]> }> ; `references`: (`value`: `unknown`) => [`InputDependency`](/api/modules/computations#inputdependency)\[]  }>

One declaration for the named, independently versioned inputs of a computation.

#### Type parameters

| Name | Type |
| :- | :- |
| `Fields` | extends [`ReferenceFields`](/api/modules/computations#referencefields) |

#### Parameters

| Name | Type |
| :- | :- |
| `fields` | `Fields` |

#### Returns

`Readonly`\<\{ `validator`: [`VObject`](/api/classes/values.VObject)\<[`Expand`](/api/modules/server#expand)\<\{ \[Property in string | number | symbol]?: Exclude\<Infer\<Fields\[Property]>, undefined> } & \{ \[Property in string | number | symbol]: Infer\<Fields\[Property]> }>, `Fields`, `"required"`, \{ \[Property in string | number | symbol]: Property | \`$\{Property & string}.$\{Fields\[Property]\["fieldPaths"]}\` }\[keyof `Fields`] & `string`> ; `validate`: (`value`: `unknown`) => [`Expand`](/api/modules/server#expand)\<\{ \[Property in string | number | symbol]?: Exclude\<Infer\<Fields\[Property]>, undefined> } & \{ \[Property in string | number | symbol]: Infer\<Fields\[Property]> }> ; `references`: (`value`: `unknown`) => [`InputDependency`](/api/modules/computations#inputdependency)\[]  }>

***

### dataset

▸ **dataset**\<`V`>(`row`): [`VObject`](/api/classes/values.VObject)\<\{ `reference`: `string` ; `kind`: `"dataset"` ; `owner`: `string` ; `version`: `string` ; `contract`: `string` ; `digest`: `string`  }, \{ `kind`: [`VLiteral`](/api/classes/values.VLiteral)\<`"dataset"`, `"required"`> ; `owner`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `reference`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `version`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `digest`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `contract`: [`VLiteral`](/api/classes/values.VLiteral)\<`string`, `"required"`>  }, `"required"`, `"reference"` | `"kind"` | `"owner"` | `"version"` | `"contract"` | `"digest"`> & \{ `type`: [`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`V`>, `"dataset"`>  }

A versioned relation result. Its owner retains bytes and checks access.

#### Type parameters

| Name | Type |
| :- | :- |
| `V` | extends [`GenericValidator`](/api/modules/values#genericvalidator) |

#### Parameters

| Name | Type |
| :- | :- |
| `row` | `V` |

#### Returns

[`VObject`](/api/classes/values.VObject)\<\{ `reference`: `string` ; `kind`: `"dataset"` ; `owner`: `string` ; `version`: `string` ; `contract`: `string` ; `digest`: `string`  }, \{ `kind`: [`VLiteral`](/api/classes/values.VLiteral)\<`"dataset"`, `"required"`> ; `owner`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `reference`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `version`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `digest`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `contract`: [`VLiteral`](/api/classes/values.VLiteral)\<`string`, `"required"`>  }, `"required"`, `"reference"` | `"kind"` | `"owner"` | `"version"` | `"contract"` | `"digest"`> & \{ `type`: [`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`V`>, `"dataset"`>  }

***

### artifact

▸ **artifact**\<`V`>(`value`): [`VObject`](/api/classes/values.VObject)\<\{ `reference`: `string` ; `kind`: `"artifact"` ; `owner`: `string` ; `version`: `string` ; `contract`: `string` ; `digest`: `string`  }, \{ `kind`: [`VLiteral`](/api/classes/values.VLiteral)\<`"artifact"`, `"required"`> ; `owner`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `reference`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `version`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `digest`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `contract`: [`VLiteral`](/api/classes/values.VLiteral)\<`string`, `"required"`>  }, `"required"`, `"reference"` | `"kind"` | `"owner"` | `"version"` | `"contract"` | `"digest"`> & \{ `type`: [`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`V`>, `"artifact"`>  }

A versioned structured result. The descriptor conveys no read authority.

#### Type parameters

| Name | Type |
| :- | :- |
| `V` | extends [`GenericValidator`](/api/modules/values#genericvalidator) |

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `V` |

#### Returns

[`VObject`](/api/classes/values.VObject)\<\{ `reference`: `string` ; `kind`: `"artifact"` ; `owner`: `string` ; `version`: `string` ; `contract`: `string` ; `digest`: `string`  }, \{ `kind`: [`VLiteral`](/api/classes/values.VLiteral)\<`"artifact"`, `"required"`> ; `owner`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `reference`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `version`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `digest`: [`VString`](/api/classes/values.VString)\<`string`, `"required"`> ; `contract`: [`VLiteral`](/api/classes/values.VLiteral)\<`string`, `"required"`>  }, `"required"`, `"reference"` | `"kind"` | `"owner"` | `"version"` | `"contract"` | `"digest"`> & \{ `type`: [`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`V`>, `"artifact"`>  }

***

### restoreValidator

▸ **restoreValidator**(`schema`): [`GenericValidator`](/api/modules/values#genericvalidator)

Reconstruct an owner-supplied value contract without losing its refinements.
This validates representation only; native admission validates declarations.

#### Parameters

| Name | Type |
| :- | :- |
| `schema` | [`ValidatorJSON`](/api/modules/values#validatorjson) |

#### Returns

[`GenericValidator`](/api/modules/values#genericvalidator)

***

### validateValue

▸ **validateValue**(`value`, `schema`, `options?`): `void`

Validate exact computation values and semantic refinements. Validation
establishes neither provenance nor read or disclosure authority.

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |
| `schema` | [`ValidatorJSON`](/api/modules/values#validatorjson) |
| `options` | `Object` |
| `options.maxBytes?` | `number` |
| `options.maxNodes?` | `number` |

#### Returns

`void`

***

### resultReference

▸ **resultReference**\<`V`>(`validator`, `identity`): `Infer`

Construct a typed descriptor from owner-supplied immutable version metadata.
The owner still establishes availability, retention and authority on use.

#### Type parameters

| Name | Type |
| :- | :- |
| `V` | extends `GenericValidator` |

#### Parameters

| Name | Type |
| :- | :- |
| `validator` | `V` |
| `identity` | `Object` |
| `identity.owner` | `string` |
| `identity.reference` | `string` |
| `identity.version` | `string` |
| `identity.digest` | `string` |

#### Returns

`Infer`

***

### resultReferences

▸ **resultReferences**(`value`, `schema`): `ResultRef`\[]

Enumerate typed reference dependencies after validating the complete value.
Semantic owners use these exact locators to acquire their own custody before
dispatch or acceptance. Enumeration grants no authority and reads no data.

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |
| `schema` | [`ValidatorJSON`](/api/modules/values#validatorjson) |

#### Returns

`ResultRef`\[]

***

### computationCustodyRelease

▸ **computationCustodyRelease**(): `boolean`

Recognize host-owned mechanical cleanup in an owner's private metadata
policies. This grants no access to a result, receipt or business record.

#### Returns

`boolean`

***

### openComputationInput

▸ **openComputationInput**(`ctx`, `reference`): `Promise`\<[`ResolvedInput`](/api/modules/requests#resolvedinput)>

Resolve only an input already held by the native evaluation. The owner
rechecks current access before releasing any payload or data locator.

#### Parameters

| Name | Type |
| :- | :- |
| `ctx` | `Pick`\<[`QueryCtx`](/api/modules/computations#queryctx), `"runQuery"`> \| `Pick`\<[`GenericActionCtx`](/api/interfaces/server.GenericActionCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>, `"runQuery"`> |
| `reference` | [`ResultRef`](/api/modules/requests#resultref)\<`any`> |

#### Returns

`Promise`\<[`ResolvedInput`](/api/modules/requests#resolvedinput)>

***

### readComputationInput

▸ **readComputationInput**\<`T`>(`ctx`, `reference`): `Promise`\<`T`>

Read a structured native artifact. Remote placement payloads stay explicit
through openComputationInput; a dataset manifest is never typed as its rows.

#### Type parameters

| Name |
| :- |
| `T` |

#### Parameters

| Name | Type |
| :- | :- |
| `ctx` | `Pick`\<[`QueryCtx`](/api/modules/computations#queryctx), `"runQuery"`> \| `Pick`\<[`GenericActionCtx`](/api/interfaces/server.GenericActionCtx)\<[`GenericDataModel`](/api/modules/server#genericdatamodel)>, `"runQuery"`> |
| `reference` | [`ResultRef`](/api/modules/requests#resultref)\<`T`, `"artifact"`> |

#### Returns

`Promise`\<`T`>

***

### defineDatasetInputOwner

▸ **defineDatasetInputOwner**\<`D`>(`options`): `Readonly`\<\{ `owner`: [`ComputationOwner`](/api/modules/computations#computationowner) ; `placement`: [`ResultPlacement`](/api/modules/requests#resultplacement) ; `reference`: \<K>(`ctx`: [`Q`](/api/modules/computations#q), `name`: `K`, `version`: `string`) => `Promise`\<[`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`D`\[`K`]\[`"row"`]>, `"dataset"`>>  }>

Exact dataset manifests as model inputs. Physical readers can provide a
declared placement reader; credentials keep their own finite lifetime.

#### Type parameters

| Name | Type |
| :- | :- |
| `D` | extends `Record`\<`string`, \{ `dataset`: `string` ; `contract`: `string` ; `row`: [`GenericValidator`](/api/modules/values#genericvalidator)  }> |

#### Parameters

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.owner` | `string` |
| `options.datasets` | [`DatasetInputCustodian`](/api/modules/computations#datasetinputcustodian) |
| `options.definitions` | `D` |
| `options.placement?` | [`ResultPlacement`](/api/modules/requests#resultplacement) |
| `options.read?` | (`ctx`: [`Q`](/api/modules/computations#q), `version`: [`Version`](/api/modules/computations#version), `pin`: [`Pin`](/api/modules/computations#pin)) => `Promise`\<[`Value`](/api/modules/values#value)> |

#### Returns

`Readonly`\<\{ `owner`: [`ComputationOwner`](/api/modules/computations#computationowner) ; `placement`: [`ResultPlacement`](/api/modules/requests#resultplacement) ; `reference`: \<K>(`ctx`: [`Q`](/api/modules/computations#q), `name`: `K`, `version`: `string`) => `Promise`\<[`ResultRef`](/api/modules/requests#resultref)\<[`Infer`](/api/modules/values#infer)\<`D`\[`K`]\[`"row"`]>, `"dataset"`>>  }>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.