mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-11 10:23:17 +08:00
Gives an actor a reliable way to learn its own ID without parsing the Host header. atelet populates a per-actor identity directory (currently the single file actor-id) and bind-mounts it read-only at /run/ate into each app container; the pause container gets none. - A directory rather than a single-file mount, per the discussion on #178, so future late-bound data can land as sibling files without changing the mount shape. - The bundle is regenerated on every resume and external bind mounts are re-attached from the restore-time config.json, so the value stays correct per-actor through a golden-snapshot restore; an env var (or a file baked into the image) would be frozen at the golden actor's ID, since it lives in the checkpointed process memory. - actor-id is written atomically (temp file, fsync, rename, parent fsync): the directory is visible to a possibly-running actor, so a reader must never observe a torn value. - The identity dir is cleared and recreated with the other per-actor dirs in resetActorDirs. - The in-rootfs mount point is created via os.Root, so a symlink planted in the image cannot redirect the write outside the extracted rootfs. Documented for actor authors in docs/api-guide.md: read it fresh on use; raw ID, no trailing newline.