ГЛОБАЛЬНЫЙ РЕФАКТОРИНГ АРХИТЕКТУРЫ - Рефакторинг - Этап 4: обновлён формат ответов и добавлено правило о русском названии коммита

This commit is contained in:
2026-04-12 01:10:08 +03:00
parent 8167bd228d
commit 5a8edfb4f3
9 changed files with 119 additions and 37 deletions
@@ -4338,15 +4338,32 @@ function renderPolicyReply(structure: AnswerStructureV11, context?: AnswerRender
limitationLines
};
const enriched = enforceDomainWordingIsolation(enrichedBase, structure, context);
const checkedLines = dedupeNarrativeLines(enriched.evidenceLines, 6);
const foundLines = dedupeNarrativeLines([...enriched.brokenLines, ...enriched.whyLines], 6);
const unresolvedLines = dedupeNarrativeLines(enriched.limitationLines, 6);
const nextStepLines = dedupeNarrativeLines(enriched.checkLines, 5);
return sanitizeUserFacingReply(
[
`Коротко: ${enriched.shortLine}`,
`Что сломано:\n${formatList(enriched.brokenLines)}`,
`Почему это похоже на проблему:\n${formatList(enriched.whyLines)}`,
`На чем это основано:\n${formatList(enriched.evidenceLines)}`,
`Что проверить первым:\n${formatList(enriched.checkLines)}`,
`Ограничения:\n${formatList(enriched.limitationLines)}`
`Что именно проверено:\n${formatList(
checkedLines.length > 0
? checkedLines
: ["Подтвержденная опора собрана частично; для полного вывода нужен дополнительный проход."]
)}`,
`Что найдено:\n${formatList(
foundLines.length > 0 ? foundLines : ["Явные отклонения по текущей опоре не подтверждены."]
)}`,
`Что пока не доказано:\n${formatList(
unresolvedLines.length > 0
? unresolvedLines
: ["Существенных ограничений в текущем срезе не выявлено."]
)}`,
`Что проверить первым:\n${formatList(
nextStepLines.length > 0
? nextStepLines
: ["Уточните период, объект или контрагента, чтобы продолжить проверку по 1С."]
)}`
]
.filter(Boolean)
.join("\n\n")
@@ -4394,6 +4411,10 @@ function renderSoftPolicyReply(input: {
}): string {
const questionType = input.context?.questionType ?? "unknown";
const shortLine = ensureSentence(buildShortSectionLine(input.structure));
const foundLines = dedupeNarrativeLines(
[...buildBrokenSectionLines(input.structure), ...buildWhySectionLines(input.structure, input.context)],
3
);
const evidenceLines = dedupeNarrativeLines(buildEvidenceSectionLines(input.structure, questionType, input.context), 3);
const limitationLines = dedupeNarrativeLines(buildLimitationsSectionLines(input.structure), 3);
const checkLines = dedupeNarrativeLines(buildChecksSectionLines(input.structure, input.context), 3);
@@ -4412,9 +4433,24 @@ function renderSoftPolicyReply(input: {
[
`Коротко: ${shortLine}`,
modeLine,
evidenceLines.length > 0 ? `Что уже проверено: ${evidenceLines.join("; ")}` : "",
limitationLines.length > 0 ? `Что пока не доказано: ${limitationLines.join("; ")}` : "",
actionLines.length > 0 ? `Что могу сделать сейчас: ${actionLines.join("; ")}` : ""
`Что именно проверено:\n${formatList(
evidenceLines.length > 0
? evidenceLines
: ["Подтвержденная опора собрана частично; для полного вывода нужна дополнительная проверка."]
)}`,
`Что найдено:\n${formatList(
foundLines.length > 0 ? foundLines : ["Пока подтверждена только часть сигнала, без финальной фиксации причины."]
)}`,
`Что пока не доказано:\n${formatList(
limitationLines.length > 0
? limitationLines
: ["Для полного вывода не хватает деталей по части требований."]
)}`,
`Что могу сделать сейчас:\n${formatList(
actionLines.length > 0
? actionLines
: ["Уточните период, объект или контрагента, чтобы завершить проверку в следующем ходе."]
)}`
]
.filter(Boolean)
.join("\n\n")