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.
Purpose
`ContractEdgeSpec` pairs an `EdgeSpec` with standard ownership metadata so graph edges can be registered, versioned, and discovered the same way other ContractSpec contracts are.
Factory
import { defineContractEdge } from '@lssm-tech/lib.contracts-spec';
export const UserToProjectEdge = defineContractEdge({
meta: {
key: 'user-to-project',
version: '1.0.0',
description: 'A user owns zero or more projects.',
stability: 'stable',
owners: ['platform.core'],
tags: ['graph'],
},
edge: { id: 'user-to-project', from: 'user', to: 'project', relation: 'has-many', cardinality: 'one-to-many', directed: true },
});Registry
Register via `EntityRegistry`:
const registry = new EntityRegistry();
registry.registerEdge(UserToProjectEdge);Related
•
`EdgeSpec` — the inline edge shape (see `entities/types.ts`)
•
`ContractEntitySpec` — entity-level wrapper that can declare edges inline
•
`EntityRegistry` — stores both entity and edge contracts