Explain a debt refusal with facts about the item
Reasons are the auditable explanation of a pure decision, so one that describes the architecture rots the moment the architecture moves. The operational refusal asserted that manual interventions were recorded by no event type: true when written, false the day OperatorInterventionRecorded landed, and still printed under every refusal after that. It now reports the counts and the thresholds they missed. Why a count is zero is not this function's business, since no intervention happening, none being recorded, and none being migrated all read the same from here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVbaKucEYBjMqVeUgJUsc1
This commit is contained in:
@@ -62,7 +62,17 @@ func TestDebtRefusalNamesTheMissingEvidence(t *testing.T) {
|
||||
t.Fatalf("want a refusal with reasons, got %+v", check)
|
||||
}
|
||||
joined := strings.Join(check.Reasons, " ")
|
||||
if !strings.Contains(joined, "manual interventions are not recorded") {
|
||||
t.Fatalf("the refusal must say the intervention count is structurally zero: %v", check.Reasons)
|
||||
// Every reason is a fact about this item. The old text asserted that no
|
||||
// event type recorded manual interventions, which stopped being true the
|
||||
// day one did, leaving a correct decision explained by a lie.
|
||||
for _, want := range []string{"1 occurrences across 1 tasks", "0 recorded, needs 1"} {
|
||||
if !strings.Contains(joined, want) {
|
||||
t.Fatalf("the refusal does not state %q: %v", want, check.Reasons)
|
||||
}
|
||||
}
|
||||
for _, forbidden := range []string{"event type", "every current log"} {
|
||||
if strings.Contains(joined, forbidden) {
|
||||
t.Fatalf("a reason describes the architecture instead of the item: %v", check.Reasons)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user