Архитектура: вернуть company activity assessment в address lane и убрать ложный organization anchor из root-scoped carryover
This commit is contained in:
@@ -66,6 +66,18 @@ describe("address counterparty utf8 regression", () => {
|
||||
it("keeps the main resolver in the supported contour for direct company activity-age wording", () => {
|
||||
const result = resolveAddressIntent("а по Альтернативе Плюс сколько лет активности в базе 1С?");
|
||||
|
||||
expect(result.intent).toBe("counterparty_activity_lifecycle");
|
||||
});
|
||||
it("classifies company activity assessment wording into lifecycle intent", () => {
|
||||
const result = resolveCounterpartyAddressIntent("Как ты оценишь деятельность компании?", utf8Deps);
|
||||
|
||||
expect(result?.intent).toBe("counterparty_activity_lifecycle");
|
||||
expect(result?.reasons).toContain("counterparty_activity_lifecycle_signal_detected");
|
||||
});
|
||||
|
||||
it("keeps the main resolver in the supported contour for company activity assessment wording", () => {
|
||||
const result = resolveAddressIntent("Как ты оценишь деятельность компании?");
|
||||
|
||||
expect(result.intent).toBe("counterparty_activity_lifecycle");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -406,4 +406,69 @@ describe("assistantRoutePolicy", () => {
|
||||
expect(decision.orchestrationContract?.hard_meta_mode).toBeNull();
|
||||
expect(decision.orchestrationContract?.followup_context_detected).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps company activity assessment follow-up in address lane when lifecycle intent is resolved from grounded continuity", () => {
|
||||
const policy = buildPolicy({
|
||||
resolveAddressIntent: () => ({ intent: "counterparty_activity_lifecycle", confidence: "high" }),
|
||||
findLastGroundedAddressAnswerDebug: () => ({
|
||||
execution_lane: "address_query",
|
||||
answer_grounding_check: { status: "grounded" },
|
||||
detected_intent: "counterparty_activity_lifecycle",
|
||||
extracted_filters: {
|
||||
organization: 'ООО "Альтернатива Плюс"',
|
||||
period_to: "2026-04-18"
|
||||
}
|
||||
}),
|
||||
resolveAddressToolGateDecision: () => ({
|
||||
runAddressLane: false,
|
||||
decision: "skip_address_lane",
|
||||
reason: "no_address_signal_after_l0"
|
||||
})
|
||||
});
|
||||
|
||||
const decision = policy.resolveAssistantOrchestrationDecision({
|
||||
rawUserMessage: "Как ты оценишь деятельность компании?",
|
||||
effectiveAddressUserMessage: "Как ты оценишь деятельность компании?",
|
||||
followupContext: null,
|
||||
llmPreDecomposeMeta: {
|
||||
applied: true,
|
||||
predecomposeContract: {
|
||||
mode: "unsupported",
|
||||
mode_confidence: "low",
|
||||
intent: "unknown",
|
||||
intent_confidence: "low"
|
||||
},
|
||||
semanticExtractionContract: {
|
||||
valid: true,
|
||||
apply_canonical_recommended: true,
|
||||
extraction: {
|
||||
query_shape: "UNKNOWN",
|
||||
aggregation_profile: "unknown"
|
||||
},
|
||||
guard_hints: {
|
||||
deep_investigation_signal_detected: false
|
||||
}
|
||||
}
|
||||
},
|
||||
sessionItems: [
|
||||
{
|
||||
role: "assistant",
|
||||
debug: {
|
||||
execution_lane: "address_query",
|
||||
answer_grounding_check: { status: "grounded" },
|
||||
detected_intent: "counterparty_activity_lifecycle",
|
||||
extracted_filters: {
|
||||
organization: 'ООО "Альтернатива Плюс"',
|
||||
period_to: "2026-04-18"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
useMock: false
|
||||
});
|
||||
|
||||
expect(decision.runAddressLane).toBe(true);
|
||||
expect(decision.toolGateDecision).toBe("run_address_lane");
|
||||
expect(decision.livingMode).toBe("address_data");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user