@crvouga/homelab 0.27.5 → 0.28.0
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.
- package/ansible/monitoring/README.md +17 -0
- package/ansible/monitoring/beszel-agent.service +1 -1
- package/ansible/ubuntu/t3-stability.py +47 -0
- package/ansible/ubuntu/tasks/recovery.yml +43 -0
- package/bootstrap/doctor.ts +32 -0
- package/bootstrap/fleet-remote-bootstrap.sh +1 -2
- package/bootstrap/global-config.ts +1 -1
- package/bootstrap/harness-handoff.ts +79 -0
- package/bootstrap/setup.ts +4 -0
- package/docs/authentication.md +2 -1
- package/docs/declared.md +1 -1
- package/docs/machine-setup.md +8 -2
- package/docs/worker-contract.md +6 -5
- package/package.json +2 -2
- package/schema/check-ids.json +16 -0
- package/src/check-owners.ts +5 -0
- package/src/check-registry.ts +6 -0
- package/src/pinned-path.ts +1 -1
- package/src/toolchain-checks.ts +35 -0
|
@@ -223,3 +223,20 @@ References: [agent](https://beszel.dev/guide/agent-installation),
|
|
|
223
223
|
[systemd](https://beszel.dev/guide/systemd),
|
|
224
224
|
[network monitors](https://beszel.dev/guide/network-monitors),
|
|
225
225
|
[backup API](https://pocketbase.io/docs/api-backups/).
|
|
226
|
+
|
|
227
|
+
### Worker T3 stability
|
|
228
|
+
|
|
229
|
+
In a worker's **Systemd Services** panel, a failed `personal-t3-stability`
|
|
230
|
+
means the watchdog crossed the restart or slow-probe limits in
|
|
231
|
+
`ansible/ubuntu/policy.json`, or its log could not be read. The worker
|
|
232
|
+
recomputes the verdict every minute from the latest 24 hours. Beszel
|
|
233
|
+
refreshes service data every ten minutes. A successful measurement clears
|
|
234
|
+
the failure, and Beszel may hide the successful oneshot.
|
|
235
|
+
|
|
236
|
+
Use `homelab check --workers --json` for the per-worker restart count and
|
|
237
|
+
`worker:t3-stability` for the reason and available hang snapshots. Beszel's
|
|
238
|
+
[service monitoring](https://beszel.dev/guide/systemd) reports service state.
|
|
239
|
+
Its [agent configuration](https://beszel.dev/guide/environment-variables)
|
|
240
|
+
has no custom-metric input, so the numeric restart chart remains open. A
|
|
241
|
+
separate exporter would require a collector and dashboard that support its
|
|
242
|
+
metrics.
|
|
@@ -15,7 +15,7 @@ Environment=KEY_FILE=/etc/personal-beszel/hub-key
|
|
|
15
15
|
Environment=TOKEN_FILE=/etc/personal-beszel/agent-token
|
|
16
16
|
Environment=DISABLE_SSH=true
|
|
17
17
|
Environment=SKIP_SYSTEMD_LOGS=true
|
|
18
|
-
Environment=SERVICE_PATTERNS=ssh.service,tailscaled.service,t3code-desktop.service,personal-fleet-sync.service
|
|
18
|
+
Environment=SERVICE_PATTERNS=ssh.service,tailscaled.service,t3code-desktop.service,personal-fleet-sync.service,personal-t3-stability.service
|
|
19
19
|
ExecStart=/usr/local/lib/personal-beszel/0.21.2/beszel-agent
|
|
20
20
|
StateDirectory=beszel-agent
|
|
21
21
|
StateDirectoryMode=0700
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Expose the watchdog stability verdict as a systemd oneshot result."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import sys
|
|
5
|
+
import time
|
|
6
|
+
from collections import deque
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
path, log_lines, restart_limit, probe_ms, probe_fraction, min_probes = sys.argv[1:]
|
|
11
|
+
since = time.time() - 86400
|
|
12
|
+
restarts = probes = slow = 0
|
|
13
|
+
try:
|
|
14
|
+
with open(path, encoding="utf-8", errors="replace") as log:
|
|
15
|
+
lines = deque(log, maxlen=int(log_lines))
|
|
16
|
+
except FileNotFoundError:
|
|
17
|
+
lines = ()
|
|
18
|
+
except OSError:
|
|
19
|
+
print("The T3 watchdog log could not be read.", file=sys.stderr)
|
|
20
|
+
return 2
|
|
21
|
+
|
|
22
|
+
for line in lines:
|
|
23
|
+
try:
|
|
24
|
+
record = json.loads(line)
|
|
25
|
+
except ValueError:
|
|
26
|
+
continue
|
|
27
|
+
if not isinstance(record, dict):
|
|
28
|
+
continue
|
|
29
|
+
stamp = record.get("t")
|
|
30
|
+
if type(stamp) not in (int, float) or not stamp >= since:
|
|
31
|
+
continue
|
|
32
|
+
if record.get("event") == "restarted" and record.get("cause") == "unresponsive":
|
|
33
|
+
restarts += 1
|
|
34
|
+
if record.get("event") == "probe" and record.get("ok") is True:
|
|
35
|
+
duration = record.get("ms")
|
|
36
|
+
if type(duration) in (int, float):
|
|
37
|
+
probes += 1
|
|
38
|
+
slow += duration > int(probe_ms)
|
|
39
|
+
|
|
40
|
+
print(f"T3 watchdog in the last 24 hours: {restarts} unresponsive restarts, "
|
|
41
|
+
f"{slow} slow probes out of {probes}.")
|
|
42
|
+
return int(restarts > int(restart_limit) or
|
|
43
|
+
(probes >= int(min_probes) and slow / probes > float(probe_fraction)))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if __name__ == "__main__":
|
|
47
|
+
sys.exit(main())
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
mode: '0755'
|
|
20
20
|
loop:
|
|
21
21
|
- t3-health.sh
|
|
22
|
+
- t3-stability.py
|
|
22
23
|
- t3-boot-readiness.py
|
|
23
24
|
- t3-hang-snapshot.sh
|
|
24
25
|
- t3-listener.py
|
|
@@ -94,6 +95,48 @@
|
|
|
94
95
|
daemon_reload: true
|
|
95
96
|
enabled: true
|
|
96
97
|
state: started
|
|
98
|
+
# Beszel reads the system manager. Run the verdict as the worker account so
|
|
99
|
+
# Beszel still needs neither access to the worker home nor journal privileges.
|
|
100
|
+
- name: Declare the T3 stability verdict for system monitoring
|
|
101
|
+
ansible.builtin.copy:
|
|
102
|
+
dest: /etc/systemd/system/personal-t3-stability.service
|
|
103
|
+
owner: root
|
|
104
|
+
group: root
|
|
105
|
+
mode: '0644'
|
|
106
|
+
content: |
|
|
107
|
+
# Managed by personal converge: ansible/ubuntu/t3-stability.py
|
|
108
|
+
[Unit]
|
|
109
|
+
Description=T3 watchdog stability verdict
|
|
110
|
+
[Service]
|
|
111
|
+
Type=oneshot
|
|
112
|
+
User={{ development_user }}
|
|
113
|
+
ExecStart=/usr/bin/python3 -I -B /usr/local/lib/personal-fleet/t3-stability.py "{{ development_home }}/.local/state/personal/t3-watchdog.ndjson" {{ t3Service.watchdogLogLines }} {{ t3Stability.maxRestarts24h }} {{ t3Stability.slowProbeMs }} {{ t3Stability.slowProbeFraction }} {{ t3Stability.minProbes }}
|
|
114
|
+
TimeoutStartSec=15s
|
|
115
|
+
MemoryMax=64M
|
|
116
|
+
NoNewPrivileges=true
|
|
117
|
+
ProtectSystem=strict
|
|
118
|
+
ProtectHome=read-only
|
|
119
|
+
PrivateTmp=true
|
|
120
|
+
- name: Declare periodic T3 stability measurement
|
|
121
|
+
ansible.builtin.copy:
|
|
122
|
+
dest: /etc/systemd/system/personal-t3-stability.timer
|
|
123
|
+
owner: root
|
|
124
|
+
group: root
|
|
125
|
+
mode: '0644'
|
|
126
|
+
content: |
|
|
127
|
+
# Managed by personal converge: ansible/ubuntu/t3-stability.py
|
|
128
|
+
[Unit]
|
|
129
|
+
Description=Update the T3 watchdog stability verdict
|
|
130
|
+
[Timer]
|
|
131
|
+
OnCalendar=minutely
|
|
132
|
+
[Install]
|
|
133
|
+
WantedBy=timers.target
|
|
134
|
+
- name: Enable the T3 stability verdict timer
|
|
135
|
+
ansible.builtin.systemd_service:
|
|
136
|
+
name: personal-t3-stability.timer
|
|
137
|
+
daemon_reload: true
|
|
138
|
+
enabled: true
|
|
139
|
+
state: started
|
|
97
140
|
- name: Declare the work-in-progress guard of agent worktrees
|
|
98
141
|
ansible.builtin.copy:
|
|
99
142
|
dest: '{{ development_home }}/.config/systemd/user/personal-worker-wip-guard.service'
|
package/bootstrap/doctor.ts
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
type GlobalConfigStanding,
|
|
18
18
|
} from './global-config';
|
|
19
19
|
|
|
20
|
+
import { harnessHandoff } from './harness-handoff';
|
|
21
|
+
|
|
20
22
|
type Tool = string | { version: string; lazy?: boolean; os?: string[] };
|
|
21
23
|
type Config = {
|
|
22
24
|
min_version?: unknown;
|
|
@@ -271,6 +273,35 @@ function installed(tools: Record<string, Tool>): Record<string, Tool> {
|
|
|
271
273
|
);
|
|
272
274
|
}
|
|
273
275
|
|
|
276
|
+
export const HANDOFF_REMEDIES = {
|
|
277
|
+
'harness-path-shadowed':
|
|
278
|
+
"Put the external owner's executable directory ahead of mise on PATH, then verify a fresh login shell.",
|
|
279
|
+
'harness-owner-missing':
|
|
280
|
+
'Use T3 Code or the chosen meta-harness to make its executable available on PATH, then verify a fresh login shell.',
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export function harnessHandoffChecks(
|
|
284
|
+
env = process.env,
|
|
285
|
+
platform = process.platform
|
|
286
|
+
): Check[] {
|
|
287
|
+
const { shadowed, missing } = harnessHandoff(env, platform);
|
|
288
|
+
const groups = {
|
|
289
|
+
'harness-path-shadowed': shadowed,
|
|
290
|
+
'harness-owner-missing': missing,
|
|
291
|
+
} as const;
|
|
292
|
+
return Object.entries(groups).flatMap(([key, commands]) => {
|
|
293
|
+
if (!commands.length) return [];
|
|
294
|
+
const id = key as keyof typeof HANDOFF_REMEDIES;
|
|
295
|
+
return [
|
|
296
|
+
{
|
|
297
|
+
id,
|
|
298
|
+
status: 'warn',
|
|
299
|
+
detail: `${commands.join(', ')}: ${HANDOFF_REMEDIES[id]}`,
|
|
300
|
+
},
|
|
301
|
+
];
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
274
305
|
export function checkMachine(
|
|
275
306
|
requireDocker = false,
|
|
276
307
|
worker = false,
|
|
@@ -290,6 +321,7 @@ export function checkMachine(
|
|
|
290
321
|
miseCheck(config.min_version),
|
|
291
322
|
worktreeTrustCheck(),
|
|
292
323
|
globalConfigCheck(),
|
|
324
|
+
...harnessHandoffChecks(),
|
|
293
325
|
{
|
|
294
326
|
id: 'github-auth',
|
|
295
327
|
status: auth.ok ? 'pass' : 'warn',
|
|
@@ -343,8 +343,7 @@ ready_file="$root/toolchain-ready"
|
|
|
343
343
|
[ ! -L "$status_file" ] && [ ! -L "$ready_file" ] || die FLEET_STATE_PATH_UNSAFE
|
|
344
344
|
# Warm: the same toolchain inputs (tool pins, locks and the setup code itself)
|
|
345
345
|
# passed within a day, so a revision that changes none of them skips the full
|
|
346
|
-
# setup. Changed inputs, a failure or an older stamp run it
|
|
347
|
-
# are still checked (and reinstalled on drift) by node convergence.
|
|
346
|
+
# setup. Changed inputs, a failure or an older stamp run it.
|
|
348
347
|
toolchain_key=$(git rev-parse HEAD:mise.toml HEAD:mise.lock HEAD:.mise HEAD:bun.lock HEAD:package.json HEAD:bootstrap 2>/dev/null | tr '\n' ' ')
|
|
349
348
|
[ -n "$toolchain_key" ] || toolchain_key=$revision
|
|
350
349
|
# The tool profiles of the fleet configuration choose what is installed, so a
|
|
@@ -15,7 +15,7 @@ const MARKER = '# Managed by homelab bootstrap/setup.ts\n';
|
|
|
15
15
|
/**
|
|
16
16
|
* Where agent harnesses create a fresh checkout per task. Every new path would
|
|
17
17
|
* need its own `mise trust`, and an untrusted mise.toml makes every mise shim
|
|
18
|
-
* (
|
|
18
|
+
* (for example, bun) exit before the project tool starts. mise honours this
|
|
19
19
|
* setting only in the global config, so it is added at publish time and never
|
|
20
20
|
* written into the repository's mise.toml.
|
|
21
21
|
*/
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { accessSync, constants, realpathSync, statSync } from 'node:fs';
|
|
2
|
+
import { delimiter, isAbsolute, join, relative, sep } from 'node:path';
|
|
3
|
+
import { miseDataDir } from './shell-path';
|
|
4
|
+
|
|
5
|
+
export const HANDOFF_COMMANDS = [
|
|
6
|
+
'antigravity',
|
|
7
|
+
'claude',
|
|
8
|
+
'codex',
|
|
9
|
+
'copilot',
|
|
10
|
+
'cursor-agent',
|
|
11
|
+
'gemini',
|
|
12
|
+
'grok',
|
|
13
|
+
'opencode',
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
function realPath(path: string): string | undefined {
|
|
17
|
+
try {
|
|
18
|
+
return realpathSync(path);
|
|
19
|
+
} catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function executable(path: string): string | undefined {
|
|
25
|
+
try {
|
|
26
|
+
accessSync(path, constants.X_OK);
|
|
27
|
+
return statSync(path).isFile() ? realPath(path) : undefined;
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function within(path: string, directory: string): boolean {
|
|
34
|
+
const subpath = relative(directory, path);
|
|
35
|
+
return (
|
|
36
|
+
subpath !== '..' && !subpath.startsWith(`..${sep}`) && !isAbsolute(subpath)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Measure inherited PATH without loading project config or running an agent.
|
|
41
|
+
* A clean machine can have no harness commands. Only flag commands currently
|
|
42
|
+
* resolving through mise, including user-bin symlinks back into its installs.
|
|
43
|
+
*/
|
|
44
|
+
export function harnessHandoff(env = process.env, platform = process.platform) {
|
|
45
|
+
const shadowed: string[] = [];
|
|
46
|
+
const missing: string[] = [];
|
|
47
|
+
if (platform !== 'darwin' && platform !== 'linux')
|
|
48
|
+
return { shadowed, missing };
|
|
49
|
+
|
|
50
|
+
const data = miseDataDir(platform, env);
|
|
51
|
+
const shims = env['MISE_SHIMS_DIR'] || join(data, 'shims');
|
|
52
|
+
const managed = [shims, join(data, 'installs')].flatMap((directory) => [
|
|
53
|
+
directory,
|
|
54
|
+
realPath(directory) ?? directory,
|
|
55
|
+
]);
|
|
56
|
+
const path = (env['PATH'] ?? '').split(delimiter).filter(isAbsolute);
|
|
57
|
+
for (const command of HANDOFF_COMMANDS) {
|
|
58
|
+
// A user-bin symlink can point at a shim which itself links to mise.
|
|
59
|
+
const shimTarget = executable(join(shims, command));
|
|
60
|
+
const matches = path.flatMap((directory) => {
|
|
61
|
+
const candidate = join(directory, command);
|
|
62
|
+
const target = executable(candidate);
|
|
63
|
+
if (!target) return [];
|
|
64
|
+
const parent = realPath(directory) ?? directory;
|
|
65
|
+
const viaMise =
|
|
66
|
+
target === shimTarget ||
|
|
67
|
+
managed.some((root) =>
|
|
68
|
+
[candidate, join(parent, command), target].some((file) =>
|
|
69
|
+
within(file, root)
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
return [viaMise];
|
|
73
|
+
});
|
|
74
|
+
if (matches[0] === true) {
|
|
75
|
+
(matches.includes(false) ? shadowed : missing).push(command);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { shadowed, missing };
|
|
79
|
+
}
|
package/bootstrap/setup.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
workspaceRoot,
|
|
17
17
|
} from './global-config';
|
|
18
18
|
import { configureShellPath } from './shell-path';
|
|
19
|
+
import { harnessHandoffChecks } from './doctor';
|
|
19
20
|
import { installNativeAws } from './native-aws';
|
|
20
21
|
import { installNativeT3 } from './native-t3';
|
|
21
22
|
|
|
@@ -54,6 +55,9 @@ export async function syncTools(
|
|
|
54
55
|
observe('managed-config');
|
|
55
56
|
const dir = globalConfigDir();
|
|
56
57
|
assertManagedConfig(dir);
|
|
58
|
+
// Reshimming can remove the only evidence of a command's previous owner.
|
|
59
|
+
for (const check of harnessHandoffChecks())
|
|
60
|
+
console.warn(`WARN ${check.id}: ${check.detail}`);
|
|
57
61
|
observe('mise');
|
|
58
62
|
const config = Bun.TOML.parse(
|
|
59
63
|
readFileSync(join(workspaceRoot, 'mise.toml'), 'utf8')
|
package/docs/authentication.md
CHANGED
|
@@ -138,10 +138,11 @@ Every failure code is in [the runbooks](runbooks.md).
|
|
|
138
138
|
| ---------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
139
139
|
| `personal-fleet-disk-gc.timer` | `ansible/ubuntu/tasks/resources.yml` | OnBootSec=10min, OnCalendar={{ gc_calendar }} |
|
|
140
140
|
| `personal-fleet-idle-reboot.timer` | `ansible/ubuntu/tasks/updates.yml` | OnBootSec={{ updates.idleReboot.minUptimeMinutes }}min, OnUnitActiveSec={{ updates.idleReboot.intervalMinutes }}min |
|
|
141
|
+
| `personal-t3-stability.timer` | `ansible/ubuntu/tasks/recovery.yml` | OnCalendar=minutely |
|
|
141
142
|
| `personal-worker-auth.timer` | `ansible/ubuntu/tasks/credentials.yml` | OnBootSec=2min, OnUnitActiveSec=10min |
|
|
142
143
|
| `personal-worker-github.timer` | `ansible/ubuntu/tasks/github.yml` | OnBootSec=2min, OnUnitActiveSec=10min |
|
|
143
144
|
| `personal-worker-recovery.timer` | `ansible/ubuntu/tasks/recovery.yml` | OnBootSec=1min, OnUnitActiveSec=1min |
|
|
144
|
-
| `personal-worker-
|
|
145
|
+
| `personal-worker-wip-guard.timer` | `ansible/ubuntu/tasks/recovery.yml` | OnBootSec=5min, OnUnitActiveSec=15min |
|
|
145
146
|
|
|
146
147
|
<!-- end: timers -->
|
|
147
148
|
|
package/docs/declared.md
CHANGED
|
@@ -20,7 +20,7 @@ meta-harness. See
|
|
|
20
20
|
| What | Declared in | Pinned by | Applied by | Measured by |
|
|
21
21
|
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
22
22
|
| The fleet: machines, services, accounts | Your `fleet.json` | The `homelab` version in your `package.json`, which names one commit | `sync` | `status` |
|
|
23
|
-
| Tools: languages and CLIs | `mise.toml` | `mise.lock`: version and checksum for each platform | `mise install --locked` | `tool:*` checks
|
|
23
|
+
| Tools: languages and CLIs | `mise.toml` | `mise.lock`: version and checksum for each platform | `mise install --locked` | `tool:*` checks |
|
|
24
24
|
| mise itself | `min_version` and `mise_*_sha256` in `mise.toml` | The digest of its release archive, held here | `bootstrap/bootstrap.sh` | `tool:mise`: the pin, or a newer one it keeps |
|
|
25
25
|
| JavaScript dependencies | `package.json` | `bun.lock` | `bun install --frozen-lockfile` | The install fails on a difference |
|
|
26
26
|
| T3 Code, server and desktop app | `t3_*` under `[vars]` in `mise.toml` | SHA-256 of each artifact | `bootstrap/native-t3.ts`; `ansible/ubuntu/t3-desktop.yml`; `ansible/macos/t3-desktop.yml` | T3 checks; `t3:version` on every machine |
|
package/docs/machine-setup.md
CHANGED
|
@@ -46,8 +46,8 @@ the managed global config/lock/sidecars, set up persistent shims on PATH, and ru
|
|
|
46
46
|
`bun install --frozen-lockfile`. The published global config also trusts the
|
|
47
47
|
agent worktree roots in `AGENT_WORKTREE_ROOTS` (`bootstrap/global-config.ts`,
|
|
48
48
|
currently `~/.t3/worktrees`): each agent task gets a new checkout, and an
|
|
49
|
-
untrusted `mise.toml` there makes
|
|
50
|
-
|
|
49
|
+
untrusted `mise.toml` there makes mise-managed project tools such as `bun`
|
|
50
|
+
fail before they start. Entries added locally with
|
|
51
51
|
`mise settings add trusted_config_paths PATH` are kept on every publish.
|
|
52
52
|
Reopen your terminal/editor afterward. To refresh
|
|
53
53
|
an already-open Unix terminal immediately, run `exec "$SHELL" -l`; an installer
|
|
@@ -495,6 +495,12 @@ the old installation. Restart login shells after migrating PATH; restart a
|
|
|
495
495
|
background app only after its active turns have drained. Run setup on the
|
|
496
496
|
manager and every worker to migrate their shell files.
|
|
497
497
|
|
|
498
|
+
The toolchain doctor and setup warn about harness commands that resolve through
|
|
499
|
+
mise on their inherited PATH. `harness-path-shadowed` means an external
|
|
500
|
+
executable was found later on PATH. `harness-owner-missing` means no external
|
|
501
|
+
executable was found on that PATH. These checks inspect executable paths
|
|
502
|
+
without starting a harness.
|
|
503
|
+
|
|
498
504
|
In a fresh Bash or Zsh login shell, run `type -a <command>` from home,
|
|
499
505
|
an ordinary repository, and a new worktree. If the first result is a mise
|
|
500
506
|
shim, look for the external executable in the other results. If one exists,
|
package/docs/worker-contract.md
CHANGED
|
@@ -345,15 +345,16 @@ no one at the machine. `t3Service.bootServingSeconds` (`ansible/ubuntu/policy.js
|
|
|
345
345
|
`T3_BOOT_SERVING_LATE` when the first successful loopback probe exceeds that limit.
|
|
346
346
|
The boot-time probe keeps its first observation in the worker's runtime
|
|
347
347
|
directory across T3 restarts. Measurement begins on the first boot after
|
|
348
|
-
installation. The
|
|
349
|
-
|
|
348
|
+
installation. The watchdog and the external route both need the loopback
|
|
349
|
+
API. A desktop
|
|
350
350
|
worker's unit stores Chromium passwords in a file under `T3CODE_HOME`
|
|
351
351
|
(`--password-store=basic`), so a locked login keyring never blocks the T3
|
|
352
352
|
path; the RDP credential stays in the volatile session keyring. The VM test
|
|
353
353
|
power-cycles the guest without a clean shutdown and requires the loopback
|
|
354
|
-
API to answer
|
|
355
|
-
|
|
356
|
-
|
|
354
|
+
API to answer and the production probe to record readiness within that
|
|
355
|
+
limit. The optional desktop VM run also checks this limit and verifies RDP
|
|
356
|
+
control while the login keyring is locked. Fleet acceptance also requires
|
|
357
|
+
checking tunnel registration after a power cut on the deployed worker.
|
|
357
358
|
|
|
358
359
|
The recovery timer keeps its unit name and watchdog log across upgrades.
|
|
359
360
|
It operates the managed T3 service. A missing desktop session still reports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/homelab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Keeps a set of development machines in sync: one manager and many workers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:crvouga/homelab",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=22"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "1f523d0e3f093cedbc514e02199f73ca65f71f11",
|
|
77
77
|
"gitCommittedAt": "2026-12-03"
|
|
78
78
|
}
|
package/schema/check-ids.json
CHANGED
|
@@ -1592,6 +1592,22 @@
|
|
|
1592
1592
|
"recipe": "docker"
|
|
1593
1593
|
}
|
|
1594
1594
|
},
|
|
1595
|
+
{
|
|
1596
|
+
"id": "tool:harness-owner-missing",
|
|
1597
|
+
"meaning": "A harness command resolves through mise and no external executable was found on PATH.",
|
|
1598
|
+
"severity": "advisory",
|
|
1599
|
+
"repair": {
|
|
1600
|
+
"manual": "The external harness owner supplies the executable and the operator controls its PATH."
|
|
1601
|
+
}
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
"id": "tool:harness-path-shadowed",
|
|
1605
|
+
"meaning": "Mise precedes an external harness executable on PATH.",
|
|
1606
|
+
"severity": "advisory",
|
|
1607
|
+
"repair": {
|
|
1608
|
+
"manual": "The external harness owner supplies the executable and the operator controls its PATH."
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1595
1611
|
{
|
|
1596
1612
|
"id": "ubuntu:baseline",
|
|
1597
1613
|
"meaning": "The Ubuntu baseline policy is applied.",
|
package/src/check-owners.ts
CHANGED
|
@@ -25,6 +25,11 @@ const PARKING =
|
|
|
25
25
|
export const CHECK_OWNERS: CheckOwner[] = [
|
|
26
26
|
// Toolchain and workstation: automatic.
|
|
27
27
|
{ pattern: 'tool:*', repair: 'workspace' },
|
|
28
|
+
{
|
|
29
|
+
pattern: 'tool:harness-*',
|
|
30
|
+
manual:
|
|
31
|
+
'The external harness owner supplies the executable and the operator controls its PATH.',
|
|
32
|
+
},
|
|
28
33
|
{ pattern: 'tool:docker-*', repair: 'docker' },
|
|
29
34
|
{ pattern: 'tool:github-auth*', repair: 'login:github' },
|
|
30
35
|
{ pattern: 'dependencies', repair: 'workspace' },
|
package/src/check-registry.ts
CHANGED
|
@@ -429,6 +429,10 @@ export const CHECK_MEANINGS: Record<string, string> = {
|
|
|
429
429
|
'A pinned tool, mise itself (tool:mise, a warning when the machine keeps a newer one) or the global mise configuration (tool:global-mise-config), is as the revision declares.',
|
|
430
430
|
'tool:docker-cli':
|
|
431
431
|
'Not applicable on a worker whose containers feature is off: the Docker CLI is not one of its tools.',
|
|
432
|
+
'tool:harness-owner-missing':
|
|
433
|
+
'A harness command resolves through mise and no external executable was found on PATH.',
|
|
434
|
+
'tool:harness-path-shadowed':
|
|
435
|
+
'Mise precedes an external harness executable on PATH.',
|
|
432
436
|
'ubuntu:baseline': 'The Ubuntu baseline policy is applied.',
|
|
433
437
|
'ubuntu:boot-policy': 'The no-sleep and session boot policy is active.',
|
|
434
438
|
'ubuntu:lid-policy':
|
|
@@ -543,6 +547,8 @@ export const CHECK_MEANINGS: Record<string, string> = {
|
|
|
543
547
|
* warning, or with `required: false`. Every other check is required: its
|
|
544
548
|
* failure blocks readiness unless the run says the check is out of scope. */
|
|
545
549
|
export const ADVISORY_CHECKS = [
|
|
550
|
+
'tool:harness-owner-missing',
|
|
551
|
+
'tool:harness-path-shadowed',
|
|
546
552
|
'beszel:leftover',
|
|
547
553
|
'github:rate-limit',
|
|
548
554
|
'manager:docker',
|
package/src/pinned-path.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
2
|
import { delimiter, join } from 'node:path';
|
|
3
3
|
|
|
4
|
-
/** mise shims resolve
|
|
4
|
+
/** mise shims resolve infrastructure tools to the version in the shared lock.
|
|
5
5
|
* Putting them first keeps an unmanaged copy elsewhere on PATH (a vendor
|
|
6
6
|
* installer in ~/.local/bin, an nvm global) from shadowing the pinned one.
|
|
7
7
|
*/
|
package/src/toolchain-checks.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { HANDOFF_REMEDIES } from '../bootstrap/doctor';
|
|
2
|
+
import { HANDOFF_COMMANDS } from '../bootstrap/harness-handoff';
|
|
1
3
|
import { join } from 'node:path';
|
|
2
4
|
import {
|
|
3
5
|
selectionArguments,
|
|
@@ -106,6 +108,33 @@ function ownCheck(id: string, status: Check['status']): Check | null {
|
|
|
106
108
|
};
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
function handoffCheck(
|
|
112
|
+
id: keyof typeof HANDOFF_REMEDIES,
|
|
113
|
+
status: unknown,
|
|
114
|
+
detail: unknown
|
|
115
|
+
): Check | null {
|
|
116
|
+
if (status !== 'warn') return null;
|
|
117
|
+
const listed =
|
|
118
|
+
typeof detail === 'string' ? detail.split(':', 1)[0]!.split(', ') : [];
|
|
119
|
+
const commands = HANDOFF_COMMANDS.filter((command) =>
|
|
120
|
+
listed.includes(command)
|
|
121
|
+
);
|
|
122
|
+
const summary =
|
|
123
|
+
id === 'harness-path-shadowed'
|
|
124
|
+
? 'Mise shadows an external harness executable on PATH.'
|
|
125
|
+
: 'Mise supplies the first harness executable on PATH, and no external executable was found there.';
|
|
126
|
+
const identified =
|
|
127
|
+
id === 'harness-path-shadowed'
|
|
128
|
+
? { id: 'tool:harness-path-shadowed' }
|
|
129
|
+
: { id: 'tool:harness-owner-missing' };
|
|
130
|
+
return {
|
|
131
|
+
...identified,
|
|
132
|
+
status: 'warn',
|
|
133
|
+
summary: commands.length ? `${commands.join(', ')}. ${summary}` : summary,
|
|
134
|
+
remedy: { action: HANDOFF_REMEDIES[id] },
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
109
138
|
function toolCheck(value: unknown): Check | null {
|
|
110
139
|
if (
|
|
111
140
|
!record(value) ||
|
|
@@ -114,6 +143,12 @@ function toolCheck(value: unknown): Check | null {
|
|
|
114
143
|
!['pass', 'fail', 'warn', 'skip'].includes(String(value['status']))
|
|
115
144
|
)
|
|
116
145
|
return null;
|
|
146
|
+
if (Object.hasOwn(HANDOFF_REMEDIES, value['id']))
|
|
147
|
+
return handoffCheck(
|
|
148
|
+
value['id'] as keyof typeof HANDOFF_REMEDIES,
|
|
149
|
+
value['status'],
|
|
150
|
+
value['detail']
|
|
151
|
+
);
|
|
117
152
|
const own = ownCheck(value['id'], value['status'] as Check['status']);
|
|
118
153
|
if (own) return own;
|
|
119
154
|
const ok = value['status'] === 'pass';
|