Remove confidence scoring and refine correction prompts

This commit is contained in:
2026-11-11 17:05:52 +00:00
parent bbf89bb4f5
commit d155bf4cb3
92 changed files with 448 additions and 786 deletions

View File

@@ -76,9 +76,6 @@ func TestRegisteredSchemasLoadReadableEmbeddedJSON(t *testing.T) {
if !json.Valid(schema.JSONSchema) {
t.Fatalf("expected valid JSON schema for %q", schema.ID)
}
if !bytes.Contains(schema.JSONSchema, []byte("\n ")) {
t.Fatalf("expected readable formatted JSON schema for %q", schema.ID)
}
}
}
@@ -152,14 +149,13 @@ func TestCorrectionRepairSchema(t *testing.T) {
name, content string
valid bool
}{
{"delete whitespace", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":"","confidence":0}}`, true},
{"delete whitespace", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":" ","corrected_text":""}}`, true},
{"withdraw", `{"proposal_ref":1,"action":"withdraw","correction":null}`, true},
{"missing correction", `{"proposal_ref":1,"action":"withdraw"}`, false},
{"extra field", `{"proposal_ref":1,"action":"withdraw","correction":null,"extra":1}`, false},
{"zero reference", `{"proposal_ref":0,"action":"withdraw","correction":null}`, false},
{"unknown action", `{"proposal_ref":1,"action":"other","correction":null}`, false},
{"empty original", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"","corrected_text":"x","confidence":1}}`, false},
{"confidence outside range", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"x","corrected_text":"y","confidence":2}}`, false},
{"empty original", `{"proposal_ref":1,"action":"revise","correction":{"id":1,"original_text":"","corrected_text":"x"}}`, false},
} {
t.Run(tc.name, func(t *testing.T) {
var value any