feat: add teaching asset prompts
This commit is contained in:
39
internal/teachingassets/service_test.go
Normal file
39
internal/teachingassets/service_test.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package teachingassets
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"tutor/internal/ontology"
|
||||
"tutor/internal/workflows"
|
||||
)
|
||||
|
||||
func TestGeneratePromptKeepsLineageAndVerificationGuard(t *testing.T) {
|
||||
onto := ontology.NewService(ontology.NewMemoryStore())
|
||||
if _, err := onto.Ingest(ontology.IngestInput{
|
||||
Title: "Backend notes",
|
||||
Body: "Idempotent API retries need transactions.",
|
||||
}); err != nil {
|
||||
t.Fatalf("Ingest error: %v", err)
|
||||
}
|
||||
service := NewService(NewMemoryStore(), onto, "gpt-image-v2")
|
||||
|
||||
prompt, err := service.GeneratePrompt(GenerateInput{
|
||||
ConceptID: "http-idempotency",
|
||||
AssetType: workflows.AssetDiagram,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("GeneratePrompt error: %v", err)
|
||||
}
|
||||
if prompt.ModelKey != "gpt-image-v2" {
|
||||
t.Fatalf("ModelKey = %q", prompt.ModelKey)
|
||||
}
|
||||
if !prompt.RequiresModelIDVerification {
|
||||
t.Fatal("expected model id verification guard")
|
||||
}
|
||||
if prompt.ReviewState != ReviewCandidate {
|
||||
t.Fatalf("ReviewState = %q", prompt.ReviewState)
|
||||
}
|
||||
if len(prompt.SourceEvidence) == 0 {
|
||||
t.Fatal("expected source evidence")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user