Simplify references and output instructions in LLM prompts

This commit is contained in:
2026-09-25 12:38:23 +00:00
parent 325c4ea7d3
commit 011b021d47
31 changed files with 248 additions and 129 deletions

View File

@@ -143,12 +143,12 @@ func (p *fixtureProvider) serve(w http.ResponseWriter, r *http.Request) {
}
if validation {
if p.mode == "span-clean" || p.mode == "span-filter" {
content = `{"validations":[{"correction_index":0,"approved":true,"confidence":0.99,"reason":"ok"},{"correction_index":1,"approved":true,"confidence":0.99,"reason":"ok"}]}`
content = `{"validations":[{"correction_index":1,"approved":true,"confidence":0.99,"reason":"ok"},{"correction_index":2,"approved":true,"confidence":0.99,"reason":"ok"}]}`
} else {
content = `{"validations":[{"correction_index":0,"approved":true,"confidence":0.99,"reason":"ok"}]}`
content = `{"validations":[{"correction_index":1,"approved":true,"confidence":0.99,"reason":"ok"}]}`
}
if p.mode == "span-negative" && validationCall == 2 {
content = `{"validations":[{"correction_index":0,"approved":false,"confidence":0.99,"reason":"would reverse meaning"}]}`
content = `{"validations":[{"correction_index":1,"approved":false,"confidence":0.99,"reason":"would reverse meaning"}]}`
}
}
}
@@ -159,10 +159,8 @@ func (p *fixtureProvider) serve(w http.ResponseWriter, r *http.Request) {
}
}
if validation && !strings.HasPrefix(p.mode, "span-") {
content = `{"validations":[{"correction_index":0,"approved":true,"confidence":0.99,"reason":"ok"}]}`
if p.mode == "repair-filter-later-failure" {
content = `{"validations":[{"correction_index":1,"approved":true,"confidence":0.99,"reason":"ok"}]}`
} else if p.mode == "invalid-decision-after-repair" {
content = `{"validations":[{"correction_index":1,"approved":true,"confidence":0.99,"reason":"ok"}]}`
if p.mode == "invalid-decision-after-repair" {
if validationCall == 1 {
content = `{"wrong":true}`
} else {
@@ -173,12 +171,12 @@ func (p *fixtureProvider) serve(w http.ResponseWriter, r *http.Request) {
if validation && strings.HasPrefix(p.mode, "decision-") {
decisions := make([]map[string]any, 0, len(requestedIndices)+2)
for _, index := range requestedIndices {
if p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 2 {
if p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 3 {
continue
}
approved := !(p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 1)
approved := !(p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 2)
decisions = append(decisions, map[string]any{"correction_index": index, "approved": approved, "confidence": 0.99, "reason": "controlled review"})
if p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 3 {
if p.mode == "decision-mixed" && len(requestedIndices) == 4 && index == 4 {
decisions = append(decisions, map[string]any{"correction_index": index, "approved": false, "confidence": 0.99, "reason": "conflicting review"})
}
}
@@ -606,9 +604,9 @@ func TestSubprocessKeepsUsableValidatorDecisionsInMixedResponse(t *testing.T) {
full, survivor := 0, 0
for _, indices := range requests {
switch {
case reflect.DeepEqual(indices, []int{0, 1, 2, 3}):
case reflect.DeepEqual(indices, []int{1, 2, 3, 4}):
full++
case reflect.DeepEqual(indices, []int{0}):
case reflect.DeepEqual(indices, []int{1}):
survivor++
default:
t.Fatalf("unexpected validation identities: %v", requests)
@@ -662,7 +660,7 @@ func TestSubprocessReportsFilteredExtraValidatorDecision(t *testing.T) {
}
requests := f.assertDecisionRequestsUseOneAttempt(t)
for _, indices := range requests {
if !reflect.DeepEqual(indices, []int{0}) {
if !reflect.DeepEqual(indices, []int{1}) {
t.Fatalf("unexpected identities: %v", requests)
}
}