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.

assistant.answer

Answer a user question using a KB snapshot with strict locale/jurisdiction gating.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: experimental
  • Owners: @examples
  • Tags: assistant, policy, locale, jurisdiction, knowledge
  • field.key.label
    assistant.answer
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    assistant.answer
    field.description.label

    Answer a user question using a KB snapshot with strict locale/jurisdiction gating.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: experimental
  • Owners: @examples
  • Tags: assistant, policy, locale, jurisdiction, knowledge
  • field.tags.label
    assistant,policy,locale,jurisdiction,knowledge
    field.owners.label
    @examples
    field.stability.label
    experimental

    Answer a user question using a KB snapshot with strict locale/jurisdiction gating.

    Goal

    Provide policy-safe answers that cite a KB snapshot or refuse.

    Context

    Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing.

    Source Definition

    import { defineCommand } from '@lssm-tech/lib.contracts-spec';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    import {
    	AssistantAnswerIRModel,
    	LLMCallEnvelopeModel,
    } from '../entities/models';
    
    export const AssistantAnswerContract = defineCommand({
    	meta: {
    		key: 'assistant.answer',
    		version: '1.0.0',
    		stability: 'experimental',
    		owners: ['@examples'],
    		tags: ['assistant', 'policy', 'locale', 'jurisdiction', 'knowledge'],
    		description:
    			'Answer a user question using a KB snapshot with strict locale/jurisdiction gating.',
    		goal: 'Provide policy-safe answers that cite a KB snapshot or refuse.',
    		context:
    			'Called by UI or workflows; must fail-closed if envelope is invalid or citations are missing.',
    	},
    	io: {
    		input: AssistantQuestionInput,
    		output: AssistantAnswerIRModel,
    		errors: {
    			LOCALE_REQUIRED: {
    				description: 'Locale is required and must be supported',
    				http: 400,
    				gqlCode: 'LOCALE_REQUIRED',
    				when: 'locale is missing or unsupported',
    			},
    			JURISDICTION_REQUIRED: {
    				description: 'Jurisdiction is required',
    				http: 400,
    				gqlCode: 'JURISDICTION_REQUIRED',
    				when: 'jurisdiction is missing',
    			},
    			KB_SNAPSHOT_REQUIRED: {
    				description: 'KB snapshot id is required',
    				http: 400,
    				gqlCode: 'KB_SNAPSHOT_REQUIRED',
    				when: 'kbSnapshotId is missing',
    			},
    			CITATIONS_REQUIRED: {
    				description: 'Answers must include citations to a KB snapshot',
    				http: 422,
    				gqlCode: 'CITATIONS_REQUIRED',
    				when: 'answer has no citations',
    			},
    			SCOPE_VIOLATION: {
    				description:
    					'Answer violates allowed scope and must be refused/escalated',
    				http: 403,
    				gqlCode: 'SCOPE_VIOLATION',
    				when: 'output includes forbidden content under the given allowedScope',
    			},
    		},
    	},
    	policy: { auth: 'user' },
    });