refactor(instruction): remove default governance instruction and update related tests

This commit is contained in:
mlogclub
2026-04-18 11:05:41 +08:00
parent 9a677a6265
commit 023ec7373b
4 changed files with 17 additions and 29 deletions
@@ -26,19 +26,12 @@ func TestAssemblerRespectsProvidedSources(t *testing.T) {
}
}
func TestAssemblerUsesDefaultGovernanceInstruction(t *testing.T) {
func TestAssemblerDoesNotInjectGovernanceInstructionWhenInputIsEmpty(t *testing.T) {
result := NewAssembler().Assemble(AssemblerInput{})
expectedSnippets := []string{
"禁止承诺未经系统确认的处理时效、完成时间、回访时间或联系时间。",
"禁止代表人工团队、技术团队、售后团队承诺后续动作",
"不能自行补充内部处理流程、SLA 或跟进安排。",
if result.Text != "" {
t.Fatalf("expected empty assembled text, got: %s", result.Text)
}
for _, snippet := range expectedSnippets {
if !strings.Contains(result.Text, snippet) {
t.Fatalf("missing governance snippet %q in assembled text: %s", snippet, result.Text)
}
}
if !result.Summary.HasGovernanceRule {
t.Fatalf("expected governance rule summary, got %#v", result.Summary)
if result.Summary.HasGovernanceRule {
t.Fatalf("expected no governance rule summary, got %#v", result.Summary)
}
}