What happens
`seedHomeFromImage` (orchestrator/src/docker.ts) fills a new home with `cp -a /home/agent/. /to/ && chown BOX_UID:BOX_GID /to`. The copy keeps the uid the image was built with (`AGENT_UID`, 1020 by default) on every file. Only the home directory itself is changed to `BOX_UID:BOX_GID`.
The container runs as `BOX_UID:BOX_GID`. When `BOX_UID` differs from the image's uid, the agent owns the directory but not the files in it, such as `.profile`, `.claude/settings.json` and `.local/bin`. `ensureBoxImage` only logs a warning for this.
What to investigate
- Is the warning enough, or must the seed chown the whole tree to `BOX_UID:BOX_GID` (`chown -R`)?
- Or must a uid mismatch be an error at boot, because a box with this home cannot work?
- ARCHITECTURE.md ("The box image builds its `agent` user on the same numbers, because ...") must say which of these is the rule.
What happens
`seedHomeFromImage` (orchestrator/src/docker.ts) fills a new home with `cp -a /home/agent/. /to/ && chown BOX_UID:BOX_GID /to`. The copy keeps the uid the image was built with (`AGENT_UID`, 1020 by default) on every file. Only the home directory itself is changed to `BOX_UID:BOX_GID`.
The container runs as `BOX_UID:BOX_GID`. When `BOX_UID` differs from the image's uid, the agent owns the directory but not the files in it, such as `.profile`, `.claude/settings.json` and `.local/bin`. `ensureBoxImage` only logs a warning for this.
What to investigate