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:
2026-08-30 14:57:25 +04:00
parent 982741fe97
commit 0aefe021b0
3 changed files with 78 additions and 4 deletions
+10 -2
View File
@@ -43,9 +43,17 @@ func CheckDebtEligibility(item domain.DebtItem) DebtCheck {
if len(why) > 0 {
return DebtCheck{true, why}
}
// Reasons state facts about this item and nothing about the
// architecture around it. The second line here used to say manual
// interventions were recorded by no event type, which was true when it
// was written and false the moment OperatorInterventionRecorded
// landed. A decision that is right for a reason that has become a lie
// cannot be audited, and why a count is zero is not this function's
// business: no intervention happened, none was recorded, or none was
// migrated all read the same from here.
return DebtCheck{false, []string{
fmt.Sprintf("needs 3 occurrences across 2 tasks, or 1 manual intervention; has %d across %d tasks with %d interventions", recurrence, tasks, manual),
"manual interventions are not recorded by any event type, so that count reads 0 on every current log",
fmt.Sprintf("breadth threshold not met: %d occurrences across %d tasks, needs 3 across 2", recurrence, tasks),
fmt.Sprintf("manual intervention threshold not met: %d recorded, needs 1", manual),
}}
case domain.DebtStructural:
if recurrence >= 3 {