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.

kb.publishSnapshot

Publish a KB snapshot for a jurisdiction.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: experimental
  • Owners: @examples
  • Tags: knowledge, snapshots, publishing
  • File: packages/examples/versioned-knowledge-base/src/operations/kb.ts
  • field.key.label
    kb.publishSnapshot
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    kb.publishSnapshot
    field.description.label

    Publish a KB snapshot for a jurisdiction.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: experimental
  • Owners: @examples
  • Tags: knowledge, snapshots, publishing
  • File: packages/examples/versioned-knowledge-base/src/operations/kb.ts
  • field.tags.label
    knowledge,snapshots,publishing
    field.owners.label
    @examples
    field.stability.label
    experimental

    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' },
    });