ContractSpec docs

OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

entityKind — usage

How to build entity references and resolve entity specs from payloads.

field.key.label
entityKind — usage
field.version.label
field.type.label
field.title.label
entityKind — usage
field.description.label

How to build entity references and resolve entity specs from payloads.

field.tags.label
rich-reference,entity,kind
field.owners.label
field.stability.label
public

Building a reference

import { asReferenceInstanceId, asReferenceKindId } from '@lssm-tech/lib.contracts-spec/rich-reference';
import { entityKind } from '@lssm-tech/lib.contracts-spec/rich-reference/kinds/entity';

const ref = {
  kindId: asReferenceKindId('entity'),
  id: asReferenceInstanceId('user-42'),
  payload: { slug: 'user', id: 'user-42', label: 'Ada Lovelace' },
  redactionState: 'unredacted',
} satisfies RichReference<EntityPayload>;

Resolving the entity spec

import { resolveEntitySpec } from '@lssm-tech/lib.contracts-spec/rich-reference/kinds/entity';

const spec = resolveEntitySpec(ref.payload, registry);
// spec is ContractEntitySpec | undefined

`sensitiveFields` for `entityKind` are `['id', 'label', 'url']`. The RichReference runtime will redact these fields based on the active KindPolicy.