Select prompt metadata for inspection
This commit is contained in:
@@ -178,6 +178,28 @@ func TestInspectRequirementsSelectionUsesExactVersionsAndProfileIdentity(t *test
|
||||
}
|
||||
}
|
||||
|
||||
func TestInspectPromptHashMatchesPreparationForCapturedConfiguration(t *testing.T) {
|
||||
prompts := oneVersionPrompt("hash-equality", "v1", contractPrompt(
|
||||
"profile", "Hello {{.name}}", nil, "", noValidationOutput,
|
||||
))
|
||||
engine := requirementsEngine(t, prompts, map[string]any{
|
||||
"profile": map[string]any{"endpoint": "https://example.test/v1", "model": "inspection-model"},
|
||||
})
|
||||
inspection, err := engine.InspectPrompt(context.Background(), "hash-equality", "v1")
|
||||
if err != nil {
|
||||
t.Fatalf("inspect captured prompt: %v", err)
|
||||
}
|
||||
prepared, err := engine.Prepare(context.Background(), promptkit.RunRequest{
|
||||
PromptID: "hash-equality", PromptVersion: "v1", Vars: map[string]string{"name": "Ada"},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("prepare captured prompt: %v", err)
|
||||
}
|
||||
if inspection.PromptHash != prepared.PromptHash {
|
||||
t.Fatalf("inspection hash=%q, preparation hash=%q", inspection.PromptHash, prepared.PromptHash)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInspectRequirementsReportsConditionalAndCompleteOptionalInventories(t *testing.T) {
|
||||
prompts := map[string]any{
|
||||
"conditional": map[string]any{"v1": contractPrompt("profile",
|
||||
|
||||
Reference in New Issue
Block a user