Include glossary guidance in proposal conversations

This commit is contained in:
2026-11-26 18:22:52 +00:00
parent 20db09bd2a
commit e0445abe48
15 changed files with 82 additions and 15 deletions

View File

@@ -31,6 +31,9 @@ collections:
{{ .TranscriptDescriptionBlock }}Glossary context:
{{ .GlossaryJSON }}
Glossary-use guidance:
{{ .GlossaryInstructionsBlock }}
Protected spellings:
{{ .ProtectedTermsJSON }}

View File

@@ -27,6 +27,9 @@ collections:
{{ .TranscriptDescriptionBlock }}Glossary context:
{{ .GlossaryJSON }}
Glossary-use guidance:
{{ .GlossaryInstructionsBlock }}
Protected spellings:
{{ .ProtectedTermsJSON }}

View File

@@ -28,6 +28,9 @@ collections:
{{ .TranscriptDescriptionBlock }}Glossary context:
{{ .GlossaryJSON }}
Glossary-use guidance:
{{ .GlossaryInstructionsBlock }}
Protected spellings:
{{ .ProtectedTermsJSON }}

View File

@@ -31,6 +31,9 @@ collections:
{{ .TranscriptDescriptionBlock }}Glossary context:
{{ .GlossaryJSON }}
Glossary-use guidance:
{{ .GlossaryInstructionsBlock }}
Protected spellings:
{{ .ProtectedTermsJSON }}

View File

@@ -112,6 +112,9 @@ func mergeSharedVariables(values map[string]string, authoritative bool) map[stri
if _, exists := result["ProtectedTermsJSON"]; !exists {
result["ProtectedTermsJSON"] = "[]"
}
if _, exists := result["GlossaryInstructionsBlock"]; !exists {
result["GlossaryInstructionsBlock"] = ""
}
return result
}

View File

@@ -19,6 +19,7 @@ func TestEmbeddedDefinitionsPrepareThroughPromptKit(t *testing.T) {
"HardeningPolicy": prompts.HardeningText(),
"TranscriptDescriptionBlock": "Transcript description:\nfixture-description\n\n",
"GlossaryJSON": "{\"name\":\"fixture-glossary\"}",
"GlossaryInstructionsBlock": "fixture-guidance",
"SectionJSON": "{\"text\":\"fixture-section\"}",
"PayloadJSON": "[{\"text\":\"fixture-correction\"}]",
}
@@ -59,6 +60,21 @@ func TestEmbeddedDefinitionsPrepareThroughPromptKit(t *testing.T) {
if strings.HasPrefix(tc.id, "audita/modules.") && !strings.Contains(rendered, "fixture-glossary") {
t.Error("missing glossary context")
}
if strings.HasPrefix(tc.id, "audita/modules.") {
if !strings.Contains(rendered, "fixture-guidance") {
t.Error("missing guidance")
}
without := make(map[string]string, len(vars))
for k, v := range vars {
if k != "GlossaryInstructionsBlock" {
without[k] = v
}
}
without = prompts.WithSharedVariables(without)
if _, err := engine.Prepare(context.Background(), pk.RunRequest{PromptID: tc.id, ProfileID: "fixture", Vars: without}); err != nil {
t.Fatalf("omitted guidance: %v", err)
}
}
missing := map[string]string{"HardeningPolicy": prompts.HardeningText()}
if _, err := engine.Prepare(context.Background(), pk.RunRequest{PromptID: tc.id, ProfileID: "fixture", Vars: missing}); err == nil {
t.Error("missing variables accepted")