feat(generation): enforce prompt budget with whole article eviction (#47)

This commit is contained in:
2026-11-25 11:47:23 +01:00
parent 3983e49ff8
commit c5b8d0d4da
31 changed files with 882 additions and 296 deletions

View File

@ -0,0 +1,15 @@
package generation
// ProviderFailure crosses the synthesis port without retaining provider payloads.
// Only these stable codes may enter the persisted outcome.
type ProviderFailure string
func (e ProviderFailure) Error() string { return e.FailureCode() }
func (e ProviderFailure) FailureCode() string {
switch string(e) {
case "summary_model_rejected", "summary_provider_limit", "summary_auth_failed", "summary_rate_limited", "summary_unavailable", "summary_timeout", "summary_canceled":
return string(e)
default:
return "summary_failed"
}
}