Clarify prompt boundaries and enforce repair decisions
This commit is contained in:
@@ -13,11 +13,11 @@ func TestDecodeRepairResponse(t *testing.T) {
|
||||
name, content string
|
||||
valid bool
|
||||
}{
|
||||
{"revision with deletion", `{"proposal_ref":2,"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":""}}`, true},
|
||||
{"withdrawal", `{"proposal_ref":2,"action":"withdraw","correction":null}`, true},
|
||||
{"wrong reference", `{"proposal_ref":1,"action":"withdraw","correction":null}`, false},
|
||||
{"missing revision", `{"proposal_ref":2,"action":"revise","correction":null}`, false},
|
||||
{"withdrawal with revision", `{"proposal_ref":2,"action":"withdraw","correction":{"id":1}}`, false},
|
||||
{"revision with deletion", `{"proposal_ref":2,"decision":{"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":""}}}`, true},
|
||||
{"withdrawal", `{"proposal_ref":2,"decision":{"action":"withdraw","correction":null}}`, true},
|
||||
{"wrong reference", `{"proposal_ref":1,"decision":{"action":"withdraw","correction":null}}`, false},
|
||||
{"missing revision", `{"proposal_ref":2,"decision":{"action":"revise","correction":null}}`, false},
|
||||
{"withdrawal with revision", `{"proposal_ref":2,"decision":{"action":"withdraw","correction":{"id":1}}}`, false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
response, err := DecodeRepairResponse([]byte(tc.content), 2)
|
||||
@@ -25,7 +25,7 @@ func TestDecodeRepairResponse(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !tc.valid {
|
||||
if response.ProposalRef == 0 || response.Action == "" {
|
||||
if response.ProposalRef == 0 || response.Decision.Action == "" {
|
||||
t.Fatalf("missing decoded evidence: %+v", response)
|
||||
}
|
||||
var failure *structuredoutput.Failure
|
||||
|
||||
Reference in New Issue
Block a user