Contracts
Describe and negotiate public contracts before using their operations. A contract declaration identifies schemas and versions; it does not grant permission to perform the declared effects.
Contract: nexa.contracts/100. API index.
Typical sequence
Define contracts during the allowed registration stage, then query compatibility and availability. A successful schema check validates the value against that schema; domain ownership and effect checks still apply.
Behavior and limits
WatchAvailability returns a subscription. Refresh dependent UI after availability changes, but do not silently rebind a required service to a different provider.
The recorded Host maps 9 of 9 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.
Operations
DefineService · DefineProviderKind · DefineExtensionPoint · Describe · List · ValidateSchema · RegisterConsumer · WatchAvailability · CheckCompatibility
DefineService
PublicContract → RegistrationRef
| Property | Contract |
|---|---|
| Local SDK method ID | 1 |
| Kind | Registration |
| Permission | nexa.contracts.write |
| Legal phases | Initialize |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Version | ulong | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Schema | SchemaRef | Exact schema identity, version and fingerprint used to validate Value. |
Methods | ServiceMethod[] | Structured ServiceMethod value; follow its linked field contract. A bounded collection; do not assume an unbounded result or unspecified ordering. |
Successful result
Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_DefineService(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineService_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
DefineProviderKind
ProviderKindDefinition → RegistrationRef
| Property | Contract |
|---|---|
| Local SDK method ID | 2 |
| Kind | Registration |
| Permission | nexa.contracts.write |
| Legal phases | Initialize |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Contract | PublicContract | Structured PublicContract value; follow its linked field contract. |
Selection | SelectionPolicy | Use an exact enum member listed in the reference. The Host can support a subset for a particular operation. |
Successful result
Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_DefineProviderKind(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineProviderKind_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
DefineExtensionPoint
ExtensionPointDefinition → RegistrationRef
| Property | Contract |
|---|---|
| Local SDK method ID | 3 |
| Kind | Registration |
| Permission | nexa.contracts.write |
| Legal phases | Initialize |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Input | SchemaRef | Structured SchemaRef value; follow its linked field contract. |
Output | SchemaRef | Structured SchemaRef value; follow its linked field contract. |
Mode | ExtensionMode | Use an exact enum member listed in the reference. The Host can support a subset for a particular operation. |
DeadlineMilliseconds | long | Requested deadline in milliseconds; queue time consumes this budget and caller deadlines can shorten it. |
MergePolicy | string | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Ordering | OrderingPolicy | Use an exact enum member listed in the reference. The Host can support a subset for a particular operation. |
Reentry | ReentryPolicy | Use an exact enum member listed in the reference. The Host can support a subset for a particular operation. |
AllowedFields | string[] | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. A bounded collection; do not assume an unbounded result or unspecified ordering. |
FailurePolicy | ProviderFailurePolicy | How this provider family reports callback failures; it does not automatically make retries safe. |
Successful result
Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_DefineExtensionPoint(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineExtensionPoint_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Describe
ContractQuery → PublicContract
| Property | Contract |
|---|---|
| Local SDK method ID | 4 |
| Kind | Query |
| Permission | nexa.contracts.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Version | ulong | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_Describe(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_Describe_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
List
PageRequest → Page<PublicContract> (wrapper, item)
| Property | Contract |
|---|---|
| Local SDK method ID | 5 |
| Kind | Query |
| Permission | nexa.contracts.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Cursor | string? | Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type. |
Limit | long | Requested bound on returned items. The Host may impose a smaller domain-specific limit. |
Successful result
Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_List(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_List_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ValidateSchema
SchemaValidationRequest → ValidationReport
| Property | Contract |
|---|---|
| Local SDK method ID | 6 |
| Kind | Query |
| Permission | nexa.contracts.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Schema | SchemaRef | Exact schema identity, version and fingerprint used to validate Value. |
Value | AbiValue | Payload interpreted using the accompanying or declared schema; Null is not a substitute for an error. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_ValidateSchema(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_ValidateSchema_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
RegisterConsumer
ConsumerDefinition → RegistrationRef
| Property | Contract |
|---|---|
| Local SDK method ID | 7 |
| Kind | Registration |
| Permission | nexa.contracts.write |
| Legal phases | Initialize |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Contract | QualifiedId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
Version | ulong | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Handler | ulong | Callback identifier registered by this plugin. A handler alone is not a public action or provider registration. |
Successful result
Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_RegisterConsumer(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_RegisterConsumer_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
WatchAvailability
QualifiedRequest → SubscriptionRef
| Property | Contract |
|---|---|
| Local SDK method ID | 8 |
| Kind | Subscription |
| Permission | nexa.contracts.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | QualifiedId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Retain the subscription identity, consume bounded batches or callbacks as specified, handle gaps, and release it when no longer needed.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_WatchAvailability(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_WatchAvailability_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
CheckCompatibility
CompatibilityRequest → ValidationReport
| Property | Contract |
|---|---|
| Local SDK method ID | 9 |
| Kind | Query |
| Permission | nexa.contracts.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Contract | QualifiedId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
Version | ulong | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
SchemaDigest | string | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Contracts_CheckCompatibility(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Contracts_CheckCompatibility_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Source: NexaCL-Plugin-SDK · Apache-2.0.