fix(daemon): pin ZOT_HOME so the autospawned zot reads its AGENTS.md #182

Merged
clawdie merged 1 commit from fix/zot-home into main 2026-06-25 05:07:53 +02:00
Owner

What

Pin ZOT_HOME in the colibri_daemon rc.d prestart:

export ZOT_HOME="${colibri_daemon_data_dir}/.local/state/zot"

Why

The daemon autospawns zot rpc, and zot resolves its config/context home as
$ZOT_HOME$XDG_STATE_HOME/zot$HOME/.local/state/zot. The spawner does
not env_clear and sets no ZOT_HOME, so the child inherits the daemon's
HOME verbatim
(verified: real-daemon autospawn → zot env has the daemon HOME,
no ZOT_HOME/XDG). Under rc.subr the daemon's HOME is not guaranteed to be
/var/db/colibri, so an AGENTS.md placed there by the seed importer could be
written to a path zot never reads. Pinning ZOT_HOME makes the path
deterministic regardless of the daemon's HOME.

Cross-repo dependency

Pairs with clawdie-iso feat/seed-population, whose seed importer writes
AGENTS.md to this same /var/db/colibri/.local/state/zot. Land together.

Verification

A zot Go unit test (readAgentsContext + ZotHome) reproduces the
HOME-mismatch miss and confirms pinning ZOT_HOME makes the AGENTS.md readable.
On a booted image, confirm with:
procstat -e $(cat /var/run/colibri/colibri-daemon.pid) | grep -E 'HOME|ZOT_HOME'.

🤖 Generated with Claude Code

## What Pin `ZOT_HOME` in the `colibri_daemon` rc.d prestart: ```sh export ZOT_HOME="${colibri_daemon_data_dir}/.local/state/zot" ``` ## Why The daemon autospawns `zot rpc`, and zot resolves its config/context home as `$ZOT_HOME` → `$XDG_STATE_HOME/zot` → `$HOME/.local/state/zot`. The spawner does not `env_clear` and sets no `ZOT_HOME`, so **the child inherits the daemon's `HOME` verbatim** (verified: real-daemon autospawn → zot env has the daemon HOME, no ZOT_HOME/XDG). Under rc.subr the daemon's `HOME` is not guaranteed to be `/var/db/colibri`, so an `AGENTS.md` placed there by the seed importer could be written to a path zot never reads. Pinning `ZOT_HOME` makes the path deterministic regardless of the daemon's `HOME`. ## Cross-repo dependency Pairs with **clawdie-iso `feat/seed-population`**, whose seed importer writes `AGENTS.md` to this same `/var/db/colibri/.local/state/zot`. **Land together.** ## Verification A zot Go unit test (`readAgentsContext` + `ZotHome`) reproduces the HOME-mismatch miss and confirms pinning `ZOT_HOME` makes the AGENTS.md readable. On a booted image, confirm with: `procstat -e $(cat /var/run/colibri/colibri-daemon.pid) | grep -E 'HOME|ZOT_HOME'`. 🤖 Generated with Claude Code
clawdie added 1 commit 2026-06-25 05:04:21 +02:00
fix(daemon): export ZOT_HOME so autospawned zot reads the right AGENTS.md
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
13a5220615
The rc.d drops privilege via su -m, which preserves the environment from
/etc/rc (HOME=/). Without an explicit ZOT_HOME, zot resolves to
/.local/state/zot — missing any AGENTS.md installed by the seed importer.

Pin ZOT_HOME to /var/db/colibri/.local/state/zot. The seed importer
(clawdie-iso) targets this same path, so AGENTS.md placed on the seed
reaches the autospawned zot's global slot.
Author
Owner

Paired merge — land with clawdie-iso#137.

This pin (ZOT_HOME=/var/db/colibri/.local/state/zot) is the runtime target for
the seed importer in clawdie-iso#137, which installs AGENTS.md to that exact
path. Neither half is useful without the other. Merge both, then verify on osa
(Layer 3).

Note: distinct from the already-merged colibri#137 (autospawn) — different repo/PR.

**Paired merge — land with [clawdie-iso#137](https://code.smilepowered.org/clawdie/clawdie-iso/pulls/137).** This pin (`ZOT_HOME=/var/db/colibri/.local/state/zot`) is the runtime target for the seed importer in clawdie-iso#137, which installs `AGENTS.md` to that exact path. Neither half is useful without the other. **Merge both, then verify on osa (Layer 3).** Note: distinct from the already-merged colibri#137 (autospawn) — different repo/PR.
clawdie merged commit e77e197e8f into main 2026-06-25 05:07:53 +02:00
clawdie deleted branch fix/zot-home 2026-06-25 05:07:53 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#182
No description provided.