Watch
0
0
Fork
You've already forked hyperhive
0

module-eval: agent-user test asserts the heal_own_dir form

This commit is contained in:
atlas 2026-10-09 10:39:43 +02:00 • committed by mara
commit 252b893bbb

View file

@ -32,7 +32,18 @@ let
name = "the agent's activation hands its own work dir to the agent user";
ok =
lib.hasInfix ''if [ "$(stat -c %U "/agents/$userName/work")" != "$userName" ]; then'' migrate
&& lib.hasInfix ''chown -hR "$userName:$userName" "/agents/$userName/work"'' migrate;
&& lib.hasInfix ''heal_own_dir "/agents/$userName/work"'' migrate;
}
{
# The helper is the only recursive chown of these dirs; it must hand the
# tree to the agent user and log a failure rather than discard it.
name = "the agent's activation hands state, harness and .claude to the agent user, logging failures";
ok =
lib.hasInfix ''chown -hR "$userName:$userName" "$1" 2>&1'' migrate
&& lib.hasInfix "could not chown $1 to $userName" migrate
&& lib.hasInfix ''heal_own_dir "/agents/$userName/state"'' migrate
&& lib.hasInfix ''heal_own_dir "/agents/$userName/harness"'' migrate
&& lib.hasInfix ''heal_own_dir "$homeDir/.claude"'' migrate;
}
{
# hive-priv creates the host socket dir `0751 root` and never chowns it,