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.
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.