Добавить в корзинуПозвонить
Найти в Дзене

4

2. Структуры interface MeaningRepresentation { intent: CoreIntent; entities: CoreEntity[]; relations: CoreRelation[]; contextHints?: ContextHints; } interface CoreIntent { type: "INFORM" | "ASK" | "EVALUATE" | "PLAN" | "CRITIQUE" | "GENERATE"; description?: string; confidence: Confidence; } interface CoreEntity { id?: CoreId; label: string; entityType: EntityType; properties?: Record<string, any>; confidence: Confidence; } interface CoreRelation { from: CoreId | string; to: CoreId | string; relationType: RelationType; description?: string; confidence: Confidence; } interface ContextHints { timeScope?: "PAST" | "PRESENT" | "FUTURE" | "MULTI"; timeHorizonYears?: number; // Для 3L – до 100 domain?: string; // "economy", "family_legacy", "security", ... } 5. ReasoningLayer (Слой рассуждений) Задача: строить объяснимые цепочки рассуждений, сценарии, планы. 5.1. Интерфейс слоя interface ReasoningLayer { reason( meaning:

4.2. Структуры

interface MeaningRepresentation {

intent: CoreIntent;

entities: CoreEntity[];

relations: CoreRelation[];

contextHints?: ContextHints;

}

interface CoreIntent {

type: "INFORM" | "ASK" | "EVALUATE" | "PLAN" | "CRITIQUE" | "GENERATE";

description?: string;

confidence: Confidence;

}

interface CoreEntity {

id?: CoreId;

label: string;

entityType: EntityType;

properties?: Record<string, any>;

confidence: Confidence;

}

interface CoreRelation {

from: CoreId | string;

to: CoreId | string;

relationType: RelationType;

description?: string;

confidence: Confidence;

}

interface ContextHints {

timeScope?: "PAST" | "PRESENT" | "FUTURE" | "MULTI";

timeHorizonYears?: number; // Для 3L – до 100

domain?: string; // "economy", "family_legacy", "security", ...

}

5. ReasoningLayer (Слой рассуждений)

Задача: строить объяснимые цепочки рассуждений, сценарии, планы.

5.1. Интерфейс слоя

interface ReasoningLayer {

reason(

meaning: MeaningRepresentation,

memorySnapshot: MemorySnapshot,

constraints?: CoreConstraints

): ReasoningTrace;

}

5.2. Структуры

interface ReasoningTrace {

steps: ReasoningStep[];

finalConclusion: ReasoningConclusion;

}

interface ReasoningStep {

stepId: string;

description: string; // Человеко-читаемое объяснение

usedEntities?: CoreId[];

usedFacts?: string[];

usedRules?: string[];

intermediateResult?: any;

confidence: Confidence;

riskImpact?: RiskLevel;

}

interface ReasoningConclusion {

summary: string; // Краткий вывод

detailed?: string; // Расширенное объяснение

recommendations?: Recommendation[];

confidence: Confidence;

riskAssessment?: RiskAssessment;

}

interface Recommendation {

actionId?: string;

description: string;

expectedOutcome?: string;

riskLevel?: RiskLevel;

timeHorizonYears?: number;

}

interface RiskAssessment {

overallRisk: RiskLevel;

factors: RiskFactor[];

}

interface RiskFactor {

name: string;

description?: string;

riskLevel: RiskLevel;

confidence: Confidence;

}

6. MemoryLayer (Слой памяти)

Задача: управлять контекстом, долговременной памятью, связью сессий.

6.1. Интерфейс слоя

interface MemoryLayer {

loadContext(sessionId: SessionId): MemorySnapshot;

updateContext(sessionId: SessionId, update: MemoryUpdate): void;

}

6.2. Структуры

interface MemorySnapshot {

sessionId: SessionId;

createdAt: Timestamp;

lastUpdatedAt: Timestamp;

shortTerm: any; // Текущий контекст диалога / задачи

longTermRefs: MemoryRef[]; // Ссылки на долгосрочные записи

}

interface MemoryRef {

id: CoreId;

type: "DOCUMENT" | "MODEL" | "PROFILE" | "HISTORY";

tags?: string[];

lastAccessedAt?: Timestamp;

}

interface MemoryUpdate {

addShortTerm?: any;

mergeShortTerm?: any;

addLongTermRefs?: MemoryRef[];

removeLongTermRefs?: CoreId[];

}

Политика приватности/retention задаётся внешним Governance‑документом, но интерфейс сюда готов.

7. GuardLayer (Слой защиты)

Задача: обеспечить соблюдение ценностей, ограничений и безопасности.

7.1. Интерфейс слоя

interface GuardLayer {

evaluate(

request: CoreRequest,

reasoningTrace: ReasoningTrace

): GuardDecision;

}

7.2. Структуры

interface GuardDecision {

allowed: boolean;

modifiedResult?: CoreResult; // Если нужно смягчить/ограничить

violations?: GuardViolation[]; // Какие правила/ценности затронуты

requiredClearanceLevel?: number; // Если запрос выше допуска

}

interface GuardViolation {

code: string; // "HARM_RISK", "PRIVACY_RISK", ...

description: string;

severity: RiskLevel;

valueConflict?: ValueConflict;

}

interface ValueProfile {

dominantValues: string[]; // e.g. ["safety", "honesty", "long_term"]

tradeOffs?: ValueTradeOff[];

}

interface ValueTradeOff {

between: [string, string]; // ["safety", "speed"]

decision: string; // Что выбрано

rationale?: string;

}