Add gated agent update planning, preserved handoff and Linux worker ports
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-14 21:48:21 +01:00
parent dc9cb1b096
commit 1e89c4577f
82 changed files with 25052 additions and 69 deletions
+7 -1
View File
@@ -57,7 +57,7 @@ export const tenantPath = (id: string, suffix = '') => `/api/v1/tenants/${encode
export const objectId = (r: RecordValue, kind: string) => text(r[`${kind}_id`] ?? r.id, `${kind}_id`);
export const pretty = (v: unknown) => JSON.stringify(v, null, 2);
export const actions = ['run_script', 'refresh_inventory', 'query_logs', 'set_service_state', 'ensure_package', 'apply_updates', 'reboot', 'apt_native_acceptance'] as const;
export const actions = ['run_script', 'refresh_inventory', 'query_logs', 'set_service_state', 'ensure_package', 'apply_updates', 'reboot', 'apt_native_acceptance', 'update_agent'] as const;
export type Action = typeof actions[number];
export const windowsPowerShellRemoteSignedProfile = 'powershell_51_remote_signed' as const;
export const fullMaintenanceScriptProfile = 'full_maintenance_v1' as const;
@@ -193,6 +193,12 @@ export function validateInput(input: PlanInput): void {
if (profile === fullMaintenanceScriptProfile && (Number(input.parameters.timeout_seconds) > (variants.some(v => record(v).os_family === 'windows') ? 120 : 300) || Number(input.parameters.max_output_bytes) > 65536)) throw new Error('Vollwartung: Linux höchstens300s / Windows höchstens120s und65536Ausgabebytes');
}
if (!['agent_service', 'root', 'system'].includes(String(input.parameters.execution_identity))) throw new Error('Explizite Ausführungsidentität erforderlich');
if (input.action === 'update_agent') {
const p = input.parameters;
if (Object.keys(p).some(key => !['release_id', 'execution_identity', 'timeout_seconds', 'max_output_bytes'].includes(key)) || input.artifact_ids !== undefined
|| !['root', 'system'].includes(String(p.execution_identity)) || p.timeout_seconds !== 600 || Number(p.max_output_bytes) > 65536) throw new Error('Agentupdate: nur feste Release-ID, Root/SYSTEM,600s/64KiB; keine freien Pins/Artefakte');
msiUuid(p.release_id); return;
}
if (input.parameters.execution_identity === 'system') {
if (input.action === 'run_script') {
if (privilegedScriptProfile(input.parameters, 'system') !== fullMaintenanceScriptProfile) throw new Error('SYSTEM-Skript benötigt ausdrücklich full_maintenance_v1');