carlos / platform Public

host: the activator's turned-off hook is a named function (plans 4d census)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 0f5b7d2cf03a63b6249c73e73ea31bfa5f95c589 parent 2201fbd
3 files changed, +6 −2
  • internal/host/agent.go +1 −1
  • internal/host/plans_disabled_test.go +1 −1
  • internal/host/plans_pass.go +4 −0
diff --git a/internal/host/agent.go b/internal/host/agent.go
index a4230ffba..892808e13 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -502,7 +502,7 @@ func runAgent(args []string, buildClaims ClaimFactory) {
svc.SetIdleFor(planIdleFor)
svc.SetMaxRunFor(planMaxRunFor) // plans 4c: the continuous-awake ceiling
// Plans 4d: what a lapse turned off is never woken, and stops.
- svc.SetDisabledFor(func(rt registry.Route) bool { return planDisabledFor(rt, rt.Host) })
+ svc.SetDisabledFor(planDisabledRoute)
// Settings spec §4.2: before any process runs a build against an
// instance's database, the build state names it, under the lease. A
// store that failed to start refuses every spawn (never "run
diff --git a/internal/host/plans_disabled_test.go b/internal/host/plans_disabled_test.go
index cdc3ebdec..445ad4c3a 100644
--- a/internal/host/plans_disabled_test.go
+++ b/internal/host/plans_disabled_test.go
@@ -30,7 +30,7 @@ func TestPlansPassKeepsDisabled(t *testing.T) {
putDisabledLimits(t, s, "bab", "a.example")
putDisabledLimits(t, s, "bdk")
plansPass(context.Background(), s, reg, plansNoEnv)
- if !planDisabledFor(throttledRoute, "a.example") {
+ if !planDisabledFor(throttledRoute, "a.example") || !planDisabledRoute(throttledRoute) {
t.Fatal("a listed route is not disabled")
}
if planDisabledFor(otherRoute, "b.example") {
diff --git a/internal/host/plans_pass.go b/internal/host/plans_pass.go
index 9c99c49ea..30ff06193 100644
--- a/internal/host/plans_pass.go
+++ b/internal/host/plans_pass.go
@@ -266,3 +266,7 @@ func planDisabledFor(rt registry.Route, host string) bool {
}
return false
}
+
+// planDisabledRoute is the activator's turned-off hook (plans 4d):
+// planDisabledFor asked about the route's own host.
+func planDisabledRoute(rt registry.Route) bool { return planDisabledFor(rt, rt.Host) }