Generalize credential lease and add lease run launcher

Replace topology-tied lease naming (LeaseTurn, LeaseCaller::unit(),
is_unit_instance, add-lease-caller, mind-self/mind-persona/swarm strings)
with LeaseScope (PerCaller, PerInvocation), LeaseHolder / LeaseHolderConfig
carrying configured provider, full systemd unit name, and scope, and
config add-lease-holder.

Add claude_connector::lease_run and the  CLI
subcommand to request a lease over the unix socket, receive the token pipe
via SCM_RIGHTS, place it on fd 3 with CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR=3,
hold the socket open until the child exits, and return its exit status.
This commit is contained in:
Meta Vens 2026-12-03 21:07:38 +01:00
commit 38f66dd29c
16 changed files with 1126 additions and 265 deletions

View file

@ -172,7 +172,7 @@ pub fn serve(
}
/// `serve` over a service the caller opened and keeps a handle to, so another
/// front of the same service (the Self-run credential lease) shares its
/// front of the same service (the credential lease) shares its
/// replay store and plan. The limits must already have been validated against the
/// service's admissions.
pub fn serve_service(