Separate glossary context from prompt protection

This commit is contained in:
2026-11-10 20:18:47 +00:00
parent a8eb5aea4d
commit 45e5b381f5
10 changed files with 46 additions and 16 deletions

View File

@@ -40,6 +40,7 @@ func TestExecuteModuleProposalBuildsMessagesFromSectionAndDescription(t *testing
Settings: cfg,
WorkingTranscript: transcript,
Glossary: glossary,
ProtectedTerms: []domain.Term{{Spelling: "Separate protection"}},
Section: &section,
},
RunSpec: contracts.ModuleRunSpec{
@@ -76,6 +77,9 @@ func TestExecuteModuleProposalBuildsMessagesFromSectionAndDescription(t *testing
if len(client.calls) != 1 || client.calls[0].PromptID != prompts.PromptIDModuleGrammarProposal || client.calls[0].Context.SectionIndex == nil || *client.calls[0].Context.SectionIndex != 7 {
t.Fatalf("unexpected stage name calls: %+v", client.calls)
}
if got := client.calls[0].Variables["ProtectedTermsJSON"]; got != `["Separate protection"]` {
t.Fatalf("protected spellings = %s", got)
}
if len(out.Proposals) != 1 || out.Proposals[0].CorrectedText != "the" {
t.Fatalf("unexpected proposals: %+v", out)
}