Files
so-many-crows/guardrails.go
T

41 lines
1.5 KiB
Go

package main
import "time"
// Guardrails exist before capabilities. Version one crows are text-only:
// no web, no files, no APIs. Each future capability gets its own guardrail
// block here before it is switched on.
type Guardrails struct {
MaxCrowsInFlight int // flock cap: concurrent crow calls
MurderSize int // crows that attack one item together
MaxItemsPerList int // todo list size cap
MaxItemChars int // per-item length cap
MaxSubtasks int // split width; subtasks never split again (depth 1)
TokenBudgetPerItem int // cost ceiling per todo item
TokenBudgetPerList int // cost ceiling per list
CrowTimeout time.Duration // a stalled crow is dropped
PromoteAfter int // clean streak needed to earn the next trust level
MaxRequestsPerMin int // requester rate cap
BaseCooldown time.Duration // first offense cooldown; doubles per strike
MaxCooldown time.Duration
MaxSpunCrows int // crow registry cap: crows the Boss may spin up
}
func DefaultGuardrails() Guardrails {
return Guardrails{
MaxCrowsInFlight: 5,
MurderSize: 3,
MaxItemsPerList: 20,
MaxItemChars: 2000,
MaxSubtasks: 4,
TokenBudgetPerItem: 20_000,
TokenBudgetPerList: 100_000,
CrowTimeout: 60 * time.Second,
PromoteAfter: 10,
MaxRequestsPerMin: 5,
BaseCooldown: 30 * time.Second,
MaxCooldown: time.Hour,
MaxSpunCrows: 8,
}
}