@crvouga/homelab 0.23.5 → 0.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1479,6 +1479,22 @@
1479
1479
  },
1480
1480
  "requirement": true
1481
1481
  },
1482
+ {
1483
+ "id": "ssh:client",
1484
+ "meaning": "SSH connectivity was measured from the declared authenticated manager.",
1485
+ "severity": "required",
1486
+ "repair": {
1487
+ "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1488
+ }
1489
+ },
1490
+ {
1491
+ "id": "ssh:configuration",
1492
+ "meaning": "The effective SSH alias reaches the declared native SSH destination, user and port without a proxy.",
1493
+ "severity": "required",
1494
+ "repair": {
1495
+ "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1496
+ }
1497
+ },
1482
1498
  {
1483
1499
  "id": "ssh:disconnected",
1484
1500
  "meaning": "The SSH session was not lost while an operation ran.",
@@ -1495,6 +1511,14 @@
1495
1511
  "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1496
1512
  }
1497
1513
  },
1514
+ {
1515
+ "id": "ssh:forwarding",
1516
+ "meaning": "A fresh strict SSH direct-tcpip channel reached the declared editor endpoint.",
1517
+ "severity": "required",
1518
+ "repair": {
1519
+ "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1520
+ }
1521
+ },
1498
1522
  {
1499
1523
  "id": "ssh:fresh-session",
1500
1524
  "meaning": "A fresh, host-key-verified SSH session succeeded.",
@@ -1528,6 +1552,22 @@
1528
1552
  "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1529
1553
  }
1530
1554
  },
1555
+ {
1556
+ "id": "ssh:policy",
1557
+ "meaning": "The effective destination SSH policy durably accepts the declared source and account with local forwarding.",
1558
+ "severity": "required",
1559
+ "repair": {
1560
+ "manual": "The consumer infrastructure owner reconciles scoped noninteractive tailnet SSH authorization; homelab verifies it and never broadens access."
1561
+ }
1562
+ },
1563
+ {
1564
+ "id": "ssh:policy-return",
1565
+ "meaning": "The effective manager SSH policy durably accepts the declared worker and account with local forwarding.",
1566
+ "severity": "required",
1567
+ "repair": {
1568
+ "manual": "The consumer infrastructure owner reconciles scoped noninteractive tailnet SSH authorization; homelab verifies it and never broadens access."
1569
+ }
1570
+ },
1531
1571
  {
1532
1572
  "id": "ssh:probe",
1533
1573
  "meaning": "A remote probe over SSH succeeded.",
@@ -1552,6 +1592,14 @@
1552
1592
  "manual": "SSH trust (host keys, keys in the agent, the alias) is set up by a person once per machine; homelab never accepts a host key for you."
1553
1593
  }
1554
1594
  },
1595
+ {
1596
+ "id": "ssh:service",
1597
+ "meaning": "The destination native SSH preference is enabled.",
1598
+ "severity": "required",
1599
+ "repair": {
1600
+ "manual": "Run converge: it reconciles the declared native SSH preference and daemon. An unreachable machine needs its consumer-owned console or a verified alternate route."
1601
+ }
1602
+ },
1555
1603
  {
1556
1604
  "id": "ssh:session",
1557
1605
  "meaning": "A noninteractive SSH session and probe succeeded.",
@@ -141,6 +141,21 @@ export const CHECK_OWNERS: CheckOwner[] = [
141
141
  'Re-converge the worker with converge: it applies the Ubuntu baseline.',
142
142
  },
143
143
  { pattern: 'platform:*', manual: HARDWARE },
144
+ {
145
+ pattern: 'ssh:service',
146
+ manual:
147
+ 'Run converge: it reconciles the declared native SSH preference and daemon. An unreachable machine needs its consumer-owned console or a verified alternate route.',
148
+ },
149
+ {
150
+ pattern: 'ssh:policy',
151
+ manual:
152
+ 'The consumer infrastructure owner reconciles scoped noninteractive tailnet SSH authorization; homelab verifies it and never broadens access.',
153
+ },
154
+ {
155
+ pattern: 'ssh:policy-return',
156
+ manual:
157
+ 'The consumer infrastructure owner reconciles scoped noninteractive tailnet SSH authorization; homelab verifies it and never broadens access.',
158
+ },
144
159
  {
145
160
  pattern: 'ssh:*',
146
161
  manual:
@@ -384,6 +384,17 @@ export const CHECK_MEANINGS: Record<string, string> = {
384
384
  'source:bootstrap':
385
385
  'The approved bootstrap source is available on the manager.',
386
386
  'ssh:agent': 'The SSH agent exposes at least one identity.',
387
+ 'ssh:configuration':
388
+ 'The effective SSH alias reaches the declared native SSH destination, user and port without a proxy.',
389
+ 'ssh:client':
390
+ 'SSH connectivity was measured from the declared authenticated manager.',
391
+ 'ssh:service': 'The destination native SSH preference is enabled.',
392
+ 'ssh:policy':
393
+ 'The effective destination SSH policy durably accepts the declared source and account with local forwarding.',
394
+ 'ssh:policy-return':
395
+ 'The effective manager SSH policy durably accepts the declared worker and account with local forwarding.',
396
+ 'ssh:forwarding':
397
+ 'A fresh strict SSH direct-tcpip channel reached the declared editor endpoint.',
387
398
  'ssh:auth': 'SSH key or agent authentication succeeded.',
388
399
  'ssh:disconnected': 'The SSH session was not lost while an operation ran.',
389
400
  'ssh:dns': 'The SSH host name resolved.',
@@ -1,3 +1,4 @@
1
+ import { sshConnectivity } from '../ssh-health';
1
2
  import { managerCustomizations } from '../state/t3-customizations';
2
3
  import { managerClientSettings } from '../state/t3-client-settings';
3
4
  import { clientFailure } from '../t3/client-settings';
@@ -416,6 +417,7 @@ function deployWithMonitoring(
416
417
  };
417
418
  return deployWorker(node, revision, {
418
419
  definition: canonical,
420
+ verifyConnectivity: (target) => sshConnectivity(target, run),
419
421
  playbook: packagePlaybook(run),
420
422
  converge,
421
423
  control: () =>
@@ -28,6 +28,7 @@ import {
28
28
  */
29
29
  export interface WorkerDeployment {
30
30
  definition: FleetDefinition;
31
+ verifyConnectivity?: (node: FleetNode) => Promise<Check[]>;
31
32
  /** Applies a playbook of the package from the manager. */
32
33
  playbook: PackagePlaybook;
33
34
  /** One converge of the worker; `tailnetKey` is handed to its bootstrap. */
@@ -108,6 +109,7 @@ export async function deployWorker(
108
109
  )
109
110
  ) {
110
111
  result.checks.push(await nativeSsh(target, deployment));
112
+ result.checks.push(...(await connectivity(target, deployment)));
111
113
  }
112
114
  result.checks.unshift(...before, ...maintenance);
113
115
  return result;
@@ -305,3 +307,12 @@ async function nativeSsh(
305
307
  remedy,
306
308
  };
307
309
  }
310
+
311
+ function connectivity(
312
+ node: FleetNode,
313
+ deployment: WorkerDeployment
314
+ ): Promise<Check[]> {
315
+ return deployment.verifyConnectivity
316
+ ? deployment.verifyConnectivity(node)
317
+ : Promise.resolve([]);
318
+ }
@@ -53,6 +53,7 @@ import { inRunCheckout, managerRunScript, rehome } from './fleet-sync-checkout';
53
53
  import { syncAccounts } from './fleet-sync-accounts';
54
54
  import { workerCopyRefusal } from './fleet-sync-worker-copy';
55
55
  import { packageInfo } from '../package-info';
56
+ import { retireLegacyMonitoring } from './legacy-monitoring';
56
57
  import {
57
58
  asksAncestry,
58
59
  asksMise,
@@ -178,7 +179,7 @@ export async function fleetSync(
178
179
  home: undefined,
179
180
  });
180
181
  if (options.schedule === 'status') return scheduleStatus(settings, run);
181
- if (options.only === 'accounts') return onlyAccounts(options, settings, run);
182
+ if (options.only) return onlyScope(options, settings, run);
182
183
  const sync = (request = options): Promise<CommandOutcome> =>
183
184
  managerSync(request, settings, {
184
185
  run,
@@ -950,14 +951,32 @@ function validateRollback(options: FleetSyncOptions): void {
950
951
  }
951
952
 
952
953
  function validateOnly(options: FleetSyncOptions): void {
953
- if (options.only !== undefined && options.only !== 'accounts')
954
- throw new FleetUsageError('--only takes one scope: accounts.');
955
- if (options.only && (options.dryRun || options.schedule))
954
+ if (
955
+ options.only !== undefined &&
956
+ !['accounts', 'legacy-monitoring'].includes(options.only)
957
+ )
958
+ throw new FleetUsageError(
959
+ '--only takes one scope: accounts or legacy-monitoring.'
960
+ );
961
+ if (
962
+ (options.only === 'accounts' && options.dryRun) ||
963
+ (options.only && options.schedule)
964
+ )
956
965
  throw new FleetUsageError(
957
966
  '--only accounts applies at once; it takes neither --dry-run nor --schedule.'
958
967
  );
959
968
  }
960
969
 
970
+ function onlyScope(
971
+ options: FleetSyncOptions,
972
+ settings: Settings,
973
+ run: Runner
974
+ ): Promise<CommandOutcome> {
975
+ return options.only === 'legacy-monitoring'
976
+ ? retireLegacyMonitoring(options, run)
977
+ : onlyAccounts(options, settings, run);
978
+ }
979
+
961
980
  /** `--only accounts`: workers keep the revision they run; only their
962
981
  * accounts change.
963
982
  */
@@ -0,0 +1,41 @@
1
+ import { join } from 'node:path';
2
+ import { PACKAGE_ROOT } from '../package-info';
3
+ import { runAnsible } from '../platform/ansible';
4
+ import type { Runner } from '../types';
5
+ import type { CommandOutcome } from './contracts';
6
+
7
+ /** A local migration with no enrollment, tool upgrade or service restart. */
8
+ export async function retireLegacyMonitoring(
9
+ options: { dryRun?: boolean },
10
+ run: Runner
11
+ ): Promise<CommandOutcome> {
12
+ const result = await runAnsible(
13
+ run,
14
+ join(PACKAGE_ROOT, 'ansible/macos/legacy-monitoring.yml'),
15
+ {
16
+ input: '{}',
17
+ check: options.dryRun === true,
18
+ timeoutMs: 60_000,
19
+ }
20
+ );
21
+ const summary = result.ok
22
+ ? options.dryRun
23
+ ? 'Legacy monitoring retirement preview passed; no jobs changed.'
24
+ : 'Legacy monitoring retired; the replacement kept its running process.'
25
+ : 'Legacy monitoring retirement refused or failed. Inspect the migration playbook in check mode; the replacement must be running.';
26
+ return {
27
+ exitCode: result.ok ? 0 : 1,
28
+ data: {
29
+ version: 1,
30
+ ok: result.ok,
31
+ checks: [
32
+ {
33
+ id: 'manager:playbook',
34
+ status: result.ok ? 'pass' : 'fail',
35
+ summary,
36
+ },
37
+ ],
38
+ },
39
+ text: summary,
40
+ };
41
+ }
@@ -284,7 +284,7 @@ function registerSync({ program, defaults, complete }: Registration) {
284
284
  )
285
285
  .option(
286
286
  '--only <scope>',
287
- 'accounts: only the account-derived configuration, on every node at once, without a full sync'
287
+ 'accounts: account configuration on every node; legacy-monitoring: retire only the replaced manager monitoring job (supports --dry-run)'
288
288
  )
289
289
  .action(async (_options, command: Command) => {
290
290
  const options = command.optsWithGlobals<
@@ -494,7 +494,7 @@ export async function managerLegacyAgents(
494
494
  summary: `MANAGER_LEGACY_AGENTS_REMAIN ${remaining.join(', ')}`,
495
495
  remedy: {
496
496
  action:
497
- 'Run converge to unload and remove legacy LaunchAgents after their replacements are installed and loaded.',
497
+ 'Run converge to retire replaced LaunchAgents. For monitoring only, preview with homelab converge --only legacy-monitoring --dry-run, then omit --dry-run; the replacement must remain running.',
498
498
  },
499
499
  }
500
500
  : {
@@ -6,6 +6,7 @@ import ubuntuPolicy from '../ansible/ubuntu/policy.json';
6
6
  import { workerReadiness } from './worker-readiness';
7
7
  import { runAnsible } from './platform/ansible';
8
8
  import { runAnsibleWithReceipt } from './platform/ansible-receipt';
9
+ import { ubuntuBaseline } from './platform/ubuntu-baseline';
9
10
  import {
10
11
  loadedT3Policy,
11
12
  stageT3Policy,
@@ -247,12 +248,11 @@ async function applyBaseline(
247
248
  const user = userInfo();
248
249
  const features = workerFeatures(fleet, node);
249
250
  const ubuntu = resolve(root, 'ansible/ubuntu');
250
- const result = await runAnsibleWithReceipt(
251
+ return ubuntuBaseline(
251
252
  run,
252
253
  resolve(ubuntu, 'baseline.yml'),
253
254
  {
254
255
  cwd: ubuntu,
255
- timeoutMs: 900_000,
256
256
  input: JSON.stringify({
257
257
  development_source: stablePath(root),
258
258
  development_user: user.username,
@@ -285,21 +285,6 @@ async function applyBaseline(
285
285
  ),
286
286
  }
287
287
  );
288
- return {
289
- cached: result.cached,
290
- checks: [
291
- {
292
- id: 'ubuntu:baseline',
293
- status: result.ok ? 'pass' : 'fail',
294
- summary: result.ok
295
- ? result.cached
296
- ? 'Ubuntu baseline unchanged since its last successful apply and its services are active (re-applied in full at least daily).'
297
- : 'Ubuntu baseline tasks completed, including always-on service recovery; effective boot/session policies require separate verification.'
298
- : 'UBUNTU_BASELINE_INCOMPLETE',
299
- ...(result.ok && result.cached ? { reused: 'receipt' as const } : {}),
300
- },
301
- ],
302
- };
303
288
  }
304
289
 
305
290
  /** Cheap probe for what the baseline owns: system services and user timers. */
@@ -1,4 +1,5 @@
1
1
  import policy from '../../ansible/ubuntu/policy.json';
2
+ import { userInfo } from 'node:os';
2
3
  import { threshold } from '../worker-sizing';
3
4
  import { diskGcReportCheck, readDiskGcReport } from '../disk-gc-report';
4
5
  import type { Check, Runner } from '../types';
@@ -11,6 +12,8 @@ const GUARDS = {
11
12
  'personal-fleet-disk-guard.service': 'DISK_GUARD_INACTIVE',
12
13
  'personal-fleet-disk-gc.timer': 'DISK_GC_TIMER_MISSING',
13
14
  };
15
+ const PRESSURE_POLICY_REMEDY =
16
+ 'Run homelab converge to restore pressure policy for the worker user service and agent slices. The policy reload applies to active agents. Inspect user.control or system.control overrides if pressure killing remains enabled; retrying an agent does not repair the policy.';
14
17
  const MIB = 1024 * 1024;
15
18
 
16
19
  /** A failure code and remedy, or undefined when the probe passes. */
@@ -77,23 +80,52 @@ const diskGcRecent: Probe = async (run) => {
77
80
  'DISK_GC_RUN_STALE',
78
81
  'Inspect the disk GC service journal and run converge for this worker.',
79
82
  ];
83
+ const budget = await run([
84
+ 'systemctl',
85
+ 'show',
86
+ '--property=MemoryMax',
87
+ '--',
88
+ 'personal-fleet-disk-gc.service',
89
+ ]);
90
+ if (
91
+ !budget.ok ||
92
+ budget.stdout.trim() !==
93
+ `MemoryMax=${policy.resourceSafety.diskGcMemoryMaxMiB * MIB}`
94
+ )
95
+ return [
96
+ 'DISK_GC_MEMORY_POLICY_STALE',
97
+ 'Run homelab converge to restore the bounded Git maintenance memory budget. Inspect service drop-ins if the effective limit still differs.',
98
+ ];
80
99
  return undefined;
81
100
  };
82
101
 
83
102
  const memoryReserved: Probe = async (run) => {
84
103
  const show = (property: string, unit: string) =>
85
104
  run(['systemctl', 'show', `--property=${property}`, '--', unit]);
86
- const user = await show('MemoryMax', 'user.slice');
87
- const root = await show('ManagedOOMSwap', '-.slice');
105
+ const [user, root, service, memory] = await Promise.all([
106
+ show('MemoryMax', 'user.slice'),
107
+ show('ManagedOOMSwap', '-.slice'),
108
+ show('ManagedOOMMemoryPressure', `user@${userInfo().uid}.service`),
109
+ run(['cat', '/proc/meminfo']),
110
+ ]);
111
+ const limit = Number(/^MemoryMax=(\d+)$/m.exec(user.stdout)?.[1]);
112
+ const physical =
113
+ Number(/^MemTotal:\s+(\d+) kB$/m.exec(memory.stdout)?.[1]) * 1024;
88
114
  const ok =
89
- /^MemoryMax=\d+$/m.test(user.stdout) &&
115
+ user.ok &&
116
+ root.ok &&
117
+ memory.ok &&
118
+ limit > 0 &&
119
+ limit < physical &&
90
120
  /^ManagedOOMSwap=kill$/m.test(root.stdout);
91
- return ok
121
+ if (!ok)
122
+ return [
123
+ 'MEMORY_RESERVE_MISSING',
124
+ 'User workloads are not capped below physical memory, or swap exhaustion is unmanaged. Reapply converge.',
125
+ ];
126
+ return service.ok && /^ManagedOOMMemoryPressure=auto$/m.test(service.stdout)
92
127
  ? undefined
93
- : [
94
- 'MEMORY_RESERVE_MISSING',
95
- 'User workloads are not capped below physical memory, or swap exhaustion is unmanaged. Reapply converge.',
96
- ];
128
+ : ['AGENT_PRESSURE_KILL_ENABLED', PRESSURE_POLICY_REMEDY];
97
129
  };
98
130
 
99
131
  const agentsBounded: Probe = async (run) =>
@@ -111,7 +143,7 @@ const agentSliceBounded: Probe = async (run) => {
111
143
  '--user',
112
144
  'show',
113
145
  'app-t3code-agents.slice',
114
- '--property=LoadState,MemoryHigh,MemoryMax,MemorySwapMax,TasksMax,CPUWeight,IOWeight',
146
+ '--property=LoadState,MemoryHigh,MemoryMax,MemorySwapMax,TasksMax,CPUWeight,IOWeight,ManagedOOMMemoryPressure',
115
147
  ]),
116
148
  run(['cat', '/proc/meminfo']),
117
149
  ]);
@@ -126,6 +158,24 @@ const agentSliceBounded: Probe = async (run) => {
126
158
  'AGENT_SLICE_MISSING',
127
159
  'Run converge and verify T3 uses app-t3code-agents.slice.',
128
160
  ];
161
+ const threads = await run([
162
+ 'systemctl',
163
+ '--user',
164
+ 'show',
165
+ 'app-t3code-agents-*.slice',
166
+ '--property=ManagedOOMMemoryPressure',
167
+ '--value',
168
+ ]);
169
+ if (
170
+ fields['ManagedOOMMemoryPressure'] !== 'auto' ||
171
+ !threads.ok ||
172
+ threads.stdout
173
+ .trim()
174
+ .split(/\s+/)
175
+ .filter(Boolean)
176
+ .some((mode) => mode !== 'auto')
177
+ )
178
+ return ['AGENT_PRESSURE_KILL_ENABLED', PRESSURE_POLICY_REMEDY];
129
179
  const mib = Math.floor(
130
180
  Number(/^MemTotal:\s+(\d+) kB$/m.exec(memory.stdout)?.[1]) / 1024
131
181
  );
@@ -416,6 +466,25 @@ export function protectionWaitsForReboot(check: Check): boolean {
416
466
  return check.id === 'worker:t3-protection' && check.status === 'warn';
417
467
  }
418
468
 
469
+ async function oomdAgentKills(run: Runner): Promise<number | undefined> {
470
+ const oomd = await run([
471
+ 'sudo',
472
+ '-n',
473
+ 'journalctl',
474
+ '--quiet',
475
+ '--unit=systemd-oomd.service',
476
+ '--since=24 hours ago',
477
+ '--output=cat',
478
+ '--grep=Killed ',
479
+ ]);
480
+ const oomdReadable =
481
+ oomd.ok || (oomd.reason === 'exit' && !oomd.stderr.trim());
482
+ const oomdKills = oomd.stdout
483
+ .split('\n')
484
+ .filter((line) => /Killed .*app-t3code-agents(?:[/.-])/.test(line)).length;
485
+ return oomdReadable ? oomdKills : undefined;
486
+ }
487
+
419
488
  export async function pressureEvents(run: Runner): Promise<Check> {
420
489
  const id = 'worker:pressure-events';
421
490
  const events = await run([
@@ -436,6 +505,7 @@ export async function pressureEvents(run: Runner): Promise<Check> {
436
505
  status: 'warn',
437
506
  summary: 'Recent pressure guard activity could not be read.',
438
507
  };
508
+ const oomdKills = await oomdAgentKills(run);
439
509
  const { stops, dryRuns, unclassified } = pressureCounts(events.stdout);
440
510
  const count = stops.cpu + stops.io + stops.memory + stops.unknown;
441
511
  const active = await run([
@@ -443,19 +513,21 @@ export async function pressureEvents(run: Runner): Promise<Check> {
443
513
  '-e',
444
514
  '/run/personal-fleet-pressure-guard/active',
445
515
  ]);
446
- const warn = Boolean(count || unclassified || active.ok);
516
+ const warn = Boolean(
517
+ count || unclassified || active.ok || oomdKills || oomdKills === undefined
518
+ );
447
519
  const pressure = active.ok
448
520
  ? 'The guard currently reports sustained pressure.'
449
521
  : 'The sustained-pressure marker is absent.';
450
522
  return {
451
523
  id,
452
524
  status: warn ? 'warn' : 'pass',
453
- summary: `In the last 24 hours the pressure guard stopped ${count} workloads (CPU: ${stops.cpu}, I/O: ${stops.io}, memory: ${stops.memory}, unknown cause: ${stops.unknown}). Dry runs: ${dryRuns}. Unclassified historical records: ${unclassified}. ${pressure}`,
525
+ summary: `In the last 24 hours the pressure guard stopped ${count} workloads (CPU: ${stops.cpu}, I/O: ${stops.io}, memory: ${stops.memory}, unknown cause: ${stops.unknown}). Dry runs: ${dryRuns}. Unclassified historical records: ${unclassified}. ${pressure} systemd-oomd agent kills: ${oomdKills ?? 'unavailable'}.`,
454
526
  ...(warn
455
527
  ? {
456
528
  remedy: {
457
529
  action:
458
- 'Inspect current CPU, I/O and memory stalls before changing capacity. The counts describe past interventions.',
530
+ 'Inspect current CPU, I/O and memory stalls before changing capacity. The counts describe past interventions. For systemd-oomd kills, run homelab converge to migrate the slice policy, then inspect the systemd-oomd journal for ancestor or swap-exhaustion kills before retrying a session.',
459
531
  command:
460
532
  'cat /proc/pressure/cpu /proc/pressure/io /proc/pressure/memory',
461
533
  },
@@ -0,0 +1,47 @@
1
+ import type { Check, CommandOptions, Runner } from '../types';
2
+ import { runAnsibleWithReceipt, type Receipt } from './ansible-receipt';
3
+
4
+ /** Cold snapshot indexes and packages can exceed fifteen minutes. Keep the
5
+ * installation bounded without cutting it off at the old cold-start deadline.
6
+ * Other playbooks retain their own budgets.
7
+ */
8
+ export async function ubuntuBaseline(
9
+ run: Runner,
10
+ playbook: string,
11
+ options: CommandOptions & { input: string },
12
+ receipt: Receipt
13
+ ): Promise<{ cached: boolean; checks: Check[] }> {
14
+ const result = await runAnsibleWithReceipt(
15
+ run,
16
+ playbook,
17
+ { ...options, timeoutMs: 30 * 60_000 },
18
+ receipt
19
+ );
20
+ const summary = result.ok
21
+ ? result.cached
22
+ ? 'Ubuntu baseline unchanged since its last successful apply and its services are active (re-applied in full at least daily).'
23
+ : 'Ubuntu baseline tasks completed, including always-on service recovery; effective boot/session policies require separate verification.'
24
+ : result.reason === 'timeout'
25
+ ? 'UBUNTU_BASELINE_TIMEOUT'
26
+ : 'UBUNTU_BASELINE_INCOMPLETE';
27
+ return {
28
+ cached: result.cached,
29
+ checks: [
30
+ {
31
+ id: 'ubuntu:baseline',
32
+ status: result.ok ? 'pass' : 'fail',
33
+ summary,
34
+ ...(result.ok && result.cached ? { reused: 'receipt' as const } : {}),
35
+ ...(result.reason === 'timeout'
36
+ ? {
37
+ remedy: {
38
+ action:
39
+ 'The Ubuntu baseline reached its bounded installation deadline. Check snapshot connectivity and package-manager activity, then run homelab converge.',
40
+ command: 'homelab converge',
41
+ },
42
+ }
43
+ : {}),
44
+ },
45
+ ],
46
+ };
47
+ }