ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг этапов 2.2 - Усилена оркестрацию в deep/address гейте и follow-up binding в assistantService.ts. Починен кейс UTF-8 follow-up refinement (теперь followup_state_usage.applied=true в нужном сценарии). Убраны регрессии по assistantLivingRouter и stage3 lifecycle probe. Корректное поведение для llm canonical candidate (чтобы не уезжало в clarification_required там, где должен быть address factual).
This commit is contained in:
@@ -16,7 +16,7 @@ export interface BuildAssistantDeepTurnCompositionInput {
|
||||
groundingCheck: AnswerGroundingCheck;
|
||||
followupUsage: AssistantFollowupUsage | null | undefined;
|
||||
investigationState: InvestigationStateWithProblemUnits | null | undefined;
|
||||
companyAnchors: unknown;
|
||||
companyAnchors: CompanyAnchorSet | null;
|
||||
normalizedPayload: NormalizeResponsePayload["normalized"];
|
||||
featureAnswerPolicyV11: boolean;
|
||||
featureProblemCentricAnswerV1: boolean;
|
||||
@@ -34,7 +34,7 @@ export interface AssistantDeepTurnCompositionOutput {
|
||||
composition: ReturnType<typeof composeAssistantAnswer>;
|
||||
}
|
||||
|
||||
function toStringArray(value: unknown): string[] {
|
||||
function toStringArray(value: string[] | null | undefined): string[] {
|
||||
if (!Array.isArray(value)) {
|
||||
return [];
|
||||
}
|
||||
@@ -43,11 +43,11 @@ function toStringArray(value: unknown): string[] {
|
||||
.filter((item) => item.length > 0);
|
||||
}
|
||||
|
||||
function normalizeCompanyAnchorSet(value: unknown): CompanyAnchorSet | null {
|
||||
function normalizeCompanyAnchorSet(value: Partial<CompanyAnchorSet> | null | undefined): CompanyAnchorSet | null {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
||||
return null;
|
||||
}
|
||||
const source = value as Record<string, unknown>;
|
||||
const source: Partial<CompanyAnchorSet> = value;
|
||||
return {
|
||||
contract_numbers: toStringArray(source.contract_numbers),
|
||||
document_numbers: toStringArray(source.document_numbers),
|
||||
|
||||
Reference in New Issue
Block a user