feat(persona): wake role runtimes only for bounded sessions

This commit is contained in:
冰朔 2026-08-07 16:29:29 +08:00
commit 67938c0798
12 changed files with 321 additions and 19 deletions

View file

@ -205,4 +205,61 @@ test("daily dispatcher unit is hardened and restricted to exact persona reposito
}),
unit,
);
const sessionTarget = fs.readFileSync(
path.join(
root,
"server-tools/persona-team-handshake/zhuyuan-persona-team-session.target",
),
"utf8",
);
assert.match(sessionTarget, /^StopWhenUnneeded=yes$/m);
for (const member of ["chenglu", "guideng", "kezhou"]) {
const serviceName =
member === "chenglu"
? "chenglu-team-handshake.service"
: `${member}-team-handshake.service`;
assert.match(sessionTarget, new RegExp(`^Requires=${serviceName}$`, "m"));
const memberUnit = fs.readFileSync(
path.join(root, "server-tools/persona-team-handshake", serviceName),
"utf8",
);
assert.match(
memberUnit,
/^PartOf=zhuyuan-persona-team-session\.target$/m,
);
assert.match(memberUnit, /^StopWhenUnneeded=yes$/m);
assert.doesNotMatch(memberUnit, /^WantedBy=multi-user\.target$/m);
}
assert.match(
unit,
/^Requires=hlcc-jd-candidate\.service zhuyuan-persona-team-session\.target$/m,
);
const deployScript = fs.readFileSync(
path.join(
root,
"server-tools/persona-team-handshake/deploy-on-demand-lifecycle.sh",
),
"utf8",
);
assert.match(deployScript, /caa7b1019517470f9d1368b6e79db49e/u);
assert.match(deployScript, /f3d4b730-7f02-452f-975b-7091a4800431/u);
assert.match(
deployScript,
/ghctl authorize \/guanghu\/current install_world_version/u,
);
assert.match(deployScript, /systemctl disable "\$\{handshakes\[@\]\}"/u);
assert.match(
deployScript,
/systemctl start zhuyuan-persona-fifth-domain-daily\.service/u,
);
assert.match(
deployScript,
/guanghu\.persona-on-demand-lifecycle-receipt\/v1/u,
);
assert.match(
deployScript,
/if test "\$\{completed\}" = 0 && test "\$\{mutated\}" = 1/u,
);
});