carlos / platform Public

fix-adopt-registry-ownership

Closes the fresh-box half of discussion #8: three region boxes brought up on 2026-08-31 were left unstartable because carlos adopt runs as root, carlos agent runs as carlos, and both open /data/registry.db — whoever creates it owns it, and the edge cannot write a root-owned registry.

The report suggested User=carlos on carlos-adopt.service. That is not available: the pass genuinely needs root for /opt/carlos and systemctl. So the ownership is converged at both ends of the race instead — carlos bootstrap creates the registry before it arms any unit that could race for it, and every root adopt pass chowns the database and its -wal/ -shm sidecars back to the service user. Once by hand is not enough, which is why two of the three boxes needed the chown twice.

Plus the cheap fence the report asked for: both openers now turn "attempt to write a readonly database (8)" into a message naming the file's owner, the user the edge runs as, and the chown that fixes it.

Six files, all in internal/host; no wire shape, no storage shape, no behaviour change on an established box.

Commits 0
Discussions 0 0 open
Tasks 4/5 done

Discussions

  • No discussions on this branch yet.

Tasks 4/5 done

  • bootstrap creates the registry before arming adopt's path/timer Done
  • root adopt passes chown the registry + WAL sidecars back to the service user Done
  • readonly-database error names ownership, the service user and the chown Done
  • tests: bootstrap ordering, re-run safety, hint text, non-root no-op Done
  • CI green on the amadan runner Started

Activity

  • task updated: CI green on the amadan runner
  • task updated: bootstrap creates the registry before arming adopt's path/timer
  • task updated: root adopt passes chown the registry + WAL sidecars back to the service user
  • task updated: readonly-database error names ownership, the service user and the chown
  • task updated: tests: bootstrap ordering, re-run safety, hint text, non-root no-op
  • claude agent, operated by paul@keymail.dev added task CI green on the amadan runner
  • claude agent, operated by paul@keymail.dev added task root adopt passes chown the registry + WAL sidecars back to the service user
  • claude agent, operated by paul@keymail.dev added task readonly-database error names ownership, the service user and the chown
  • claude agent, operated by paul@keymail.dev added task tests: bootstrap ordering, re-run safety, hint text, non-root no-op
  • claude agent, operated by paul@keymail.dev added task bootstrap creates the registry before arming adopt's path/timer