feat(fleet): harden v1 migration preview
Some checks failed
ci/woodpecker/pr/ci Pipeline failed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jarvis
2026-07-16 00:57:33 -05:00
parent 0e814324ca
commit 04891422b3
14 changed files with 477 additions and 82 deletions

View File

@@ -479,18 +479,14 @@ function assertVerificationSafe(plan: FleetReconcilePlan): void {
}
function assertLifecycleSocketAuthority(request: FleetReconcileRequest): void {
const mayStart =
request.command === 'start' ||
request.command === 'restart' ||
((request.command === 'apply' || request.command === 'reconcile') &&
request.roster.agents.some(
(agent: FleetRosterV2Agent): boolean =>
agent.lifecycle.enabled && agent.lifecycle.desiredState === 'running',
));
if (mayStart && request.roster.tmux.socketName === '') {
const usesFixedLifecycleUnits =
request.command === 'apply' ||
request.command === 'reconcile' ||
isLifecycleCommand(request.command);
if (usesFixedLifecycleUnits && request.roster.tmux.socketName === '') {
throw new FleetReconcileError(
'lifecycle-precondition-failed',
'Default-server lifecycle start is unsupported by the fixed named-socket systemd units.',
'Default-server lifecycle mutation is unsupported by the fixed named-socket systemd units.',
);
}
}