Remove resource pools, leases and wait queues

Drop the resource allocation feature end to end: store tables and migration, runner scheduling and cleanup, protocol types and commands, CLI commands, TUI screens, tests and docs. Existing databases open cleanly and definitions carrying a retired resources block still validate.
This commit is contained in:
2026-10-19 22:27:27 +01:00
parent a676b30ff0
commit 72aecd8b1f
45 changed files with 282 additions and 3954 deletions
+3 -18
View File
@@ -44,12 +44,9 @@ func decodeControl(text string, value any) error {
}
func parseControl(s *Stage, fields map[string]string) error {
if text, ok := fields["resources"]; ok {
if err := decodeControl(text, &s.Resources); err != nil || s.Resources == nil || !validStageResources(*s.Resources) {
return fmt.Errorf("resources must contain exactly one exclusive or pool key (1–128 ASCII letters, digits, _ or -; start with a letter)")
}
delete(fields, "resources")
}
// A resources block from a definition created before the feature was removed
// is ignored: it no longer declares scheduling or validation.
delete(fields, "resources")
if text, ok := fields["limits"]; ok {
if err := decodeControl(text, &s.Limits); err != nil || s.Limits == nil {
return fmt.Errorf("limits must be an object with max_visits and optional on outcomes")
@@ -81,15 +78,7 @@ func parseControl(s *Stage, fields map[string]string) error {
return nil
}
func validStageResources(resources protocol.StageResources) bool {
return (ValidResourceKey(resources.Exclusive) && resources.Pool == "") ||
(resources.Exclusive == "" && ValidResourceKey(resources.Pool))
}
func validateControl(s Stage, stages map[string]bool) error {
if s.Resources != nil && s.Type == "human" {
return fmt.Errorf("stage %s: human stages cannot declare resources", s.Key)
}
if s.Limits != nil {
for _, outcome := range s.Limits.On {
target, exists := s.Edges[outcome]
@@ -109,7 +98,3 @@ func validateControl(s Stage, stages map[string]bool) error {
}
return nil
}
func ValidResourceKey(key string) bool {
return len(key) <= 128 && identifier.MatchString(key)
}