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.
Publish a KB snapshot for a jurisdiction.
Goal
Create a stable snapshot that assistant answers can cite.
Context
Publishing happens after approvals; snapshot is referenced by answers.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import {
KBSnapshotModel,
RuleVersionModel,
SourceDocumentModel,
SourceRefModel,
} from '../entities/models';
export const KbPublishSnapshotContract = defineCommand({
meta: {
key: 'kb.publishSnapshot',
title: 'Publish Snapshot',
version: '1.0.0',
stability: 'experimental',
owners: ['@examples'],
tags: ['knowledge', 'snapshots', 'publishing'],
description: 'Publish a KB snapshot for a jurisdiction.',
goal: 'Create a stable snapshot that assistant answers can cite.',
context:
'Publishing happens after approvals; snapshot is referenced by answers.',
},
io: {
input: PublishSnapshotInput,
output: KBSnapshotModel,
errors: {
NO_APPROVED_RULES: {
description: 'No approved rule versions available to publish',
http: 409,
gqlCode: 'NO_APPROVED_RULES',
when: 'jurisdiction has zero approved rule versions',
},
},
},
policy: { auth: 'user' },
});