Архитектура: ввести answer-inspection follow-up contract и закрыть phase15 replay

This commit is contained in:
2026-04-18 23:04:37 +03:00
parent c605fae3a3
commit 1d48f01841
16 changed files with 575 additions and 13 deletions
@@ -57,6 +57,7 @@ export function createAssistantRoutePolicy(deps) {
resolveMetaSignalSet,
resolveHardMetaMode,
isMetaFollowupOverGroundedAnswer,
isAnswerInspectionFollowupOverGroundedAnswer,
hasDataRetrievalRequestSignal,
hasOrganizationFactLookupSignal,
hasOrganizationFactFollowupSignal,
@@ -619,6 +620,7 @@ export function createAssistantRoutePolicy(deps) {
};
}
const metaAnswerFollowupSignal = metaSignals.metaAnswerFollowupSignal;
const answerInspectionFollowupSignal = metaSignals.answerInspectionFollowupSignal;
const preserveAddressLaneSignal = Boolean((llmPreDecomposeMeta?.llmCanonicalCandidateDetected &&
llmPreDecomposeMeta?.applied &&
llmContractMode === "address_query") ||
@@ -746,6 +748,23 @@ export function createAssistantRoutePolicy(deps) {
followupContext,
hasPriorAddressAnswerContext,
metaAnswerFollowupSignal,
answerInspectionFollowupSignal,
vatEvaluativeFollowupSignal,
dataScopeMetaQuery,
capabilityMetaQuery,
aggregateBusinessAnalyticsSignal,
dataRetrievalSignal,
strongDataSignal,
resolvedMode: resolvedModeDetection.mode,
resolvedIntent: resolvedIntentResolution.intent,
llmContractIntent,
llmContractMode
});
const answerInspectionFollowupOverGroundedAnswer = isAnswerInspectionFollowupOverGroundedAnswer({
followupContext,
hasPriorAddressAnswerContext,
metaAnswerFollowupSignal,
answerInspectionFollowupSignal,
vatEvaluativeFollowupSignal,
dataScopeMetaQuery,
capabilityMetaQuery,
@@ -801,6 +820,11 @@ export function createAssistantRoutePolicy(deps) {
toolGateDecision = "skip_address_lane";
toolGateReason = "meta_followup_over_grounded_answer";
}
if (answerInspectionFollowupOverGroundedAnswer) {
runAddressLane = false;
toolGateDecision = "skip_address_lane";
toolGateReason = "answer_inspection_followup_over_grounded_answer";
}
let livingDecision = resolveLivingAssistantModeDecision({
userMessage: rawUserMessage,
addressLaneTriggered: runAddressLane,
@@ -841,6 +865,12 @@ export function createAssistantRoutePolicy(deps) {
reason: "meta_followup_over_grounded_answer"
};
}
if (answerInspectionFollowupOverGroundedAnswer) {
livingDecision = {
mode: "chat",
reason: "answer_inspection_followup_detected"
};
}
return {
runAddressLane,
toolGateDecision,
@@ -873,6 +903,7 @@ export function createAssistantRoutePolicy(deps) {
deep_analysis_signal_fallback_to_deep: deepAnalysisSignalFallbackToDeep,
aggregate_analytics_signal_fallback_to_deep: aggregateAnalyticsFallbackToDeep,
deep_session_continuation_fallback_to_deep: deepSessionContinuationFallbackToDeep,
answer_inspection_followup_over_grounded_answer: answerInspectionFollowupOverGroundedAnswer,
final_decision: {
run_address_lane: runAddressLane,
tool_gate_decision: toolGateDecision,