carlos / platform Public

db forward task 13 (fix): the claim census classifies carlos-dbread.socket's install link

ensureSystemUnits now enables carlos-dbread.socket, so its
sockets.target.wants link appears on every box. claimCensusEnabledUnits
listed ensureSystemUnits' armed units by hand and did not know it, so a
claim installation refused the box (TestClaimProductionCensusInstallsThroughReconciler
and three relocation census tests went red). Both now read one list,
ensureSystemArmed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 8eda65a5e7648b11582cc34ba7c8c1fd83a6a646 parent c773902
2 files changed, +8 −2
  • internal/host/claimcensus.go +1 −1
  • internal/host/systemunits.go +7 −1
diff --git a/internal/host/claimcensus.go b/internal/host/claimcensus.go
index a3ae91acb..71bb2cebb 100644
--- a/internal/host/claimcensus.go
+++ b/internal/host/claimcensus.go
@@ -155,7 +155,7 @@ func claimOptCensus(optDir string) []string {
// own plan) and ensureSystemUnits' second belt.
func claimCensusEnabledUnits() []string {
units := currentBootstrapPlan().Enabled
- for _, u := range []string{systemUpdatePathUnit, systemRecoverUnit, instanceControlSocket} {
+ for _, u := range ensureSystemArmed {
if !slices.Contains(units, u) {
units = append(units, u)
}
diff --git a/internal/host/systemunits.go b/internal/host/systemunits.go
index bca16b8a5..3cb8a949d 100644
--- a/internal/host/systemunits.go
+++ b/internal/host/systemunits.go
@@ -19,6 +19,12 @@ const systemRecoverUnit = "carlos-system-recover.service"
// control channel at all.
const instanceControlSocket = "carlos-instance-control.socket"
+// ensureSystemArmed is what ensureSystemUnits arms (systemctlPlan: enable,
+// and start for the path unit and the sockets). The claim census reads the
+// same list (claimCensusEnabledUnits), so a unit armed here always has its
+// install links classified there.
+var ensureSystemArmed = []string{systemUpdatePathUnit, systemRecoverUnit, instanceControlSocket, dbReadSocketUnit}
+
// carlos-dbread.socket and its service template are the db-read worker's
// (db region forward spec §8.3): installed and the socket armed here, the
// template never started.
@@ -138,7 +144,7 @@ func ensureSystemUnits(etcDir, lockPath string, systemctl, probe func(args ...st
return
}
}
- for _, args := range systemctlPlan([]string{systemUpdatePathUnit, systemRecoverUnit, instanceControlSocket, dbReadSocketUnit}) {
+ for _, args := range systemctlPlan(ensureSystemArmed) {
if _, err := systemctl(args...); err != nil {
logf("adopt: system units: systemctl %s: %v", strings.Join(args, " "), err)
return