@crvouga/dev-fleet 0.3.0 → 0.4.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.
Files changed (77) hide show
  1. package/README.md +22 -16
  2. package/ansible/github/git.yml +66 -0
  3. package/ansible/macos/policy.json +11 -1
  4. package/ansible/monitoring/compose.yml +10 -0
  5. package/ansible/monitoring/container-watchdog.py +118 -0
  6. package/ansible/monitoring/hub-darwin.yml +146 -0
  7. package/ansible/net/remote-probe.sh +5 -0
  8. package/ansible/ubuntu/baseline.yml +2 -0
  9. package/ansible/ubuntu/disk-gc.py +25 -3
  10. package/ansible/ubuntu/disk-guard.py +24 -5
  11. package/ansible/ubuntu/policy.json +50 -1
  12. package/ansible/ubuntu/tasks/browser.yml +56 -0
  13. package/ansible/ubuntu/tasks/docker.yml +52 -0
  14. package/ansible/ubuntu/tasks/resources.yml +2 -2
  15. package/ansible/ubuntu/tasks/services.yml +13 -0
  16. package/bootstrap/doctor.ts +32 -6
  17. package/bootstrap/fleet-remote-bootstrap.sh +31 -4
  18. package/bootstrap/setup.ts +23 -8
  19. package/bootstrap/worker-tools.ts +118 -0
  20. package/cliproxy/README.md +1 -1
  21. package/cliproxy/compose.yaml +4 -0
  22. package/cliproxy/scripts/checkpoint.py +1 -1
  23. package/docs/authentication.md +90 -0
  24. package/docs/declared.md +2 -0
  25. package/docs/machine-setup.md +22 -12
  26. package/docs/operations.md +87 -31
  27. package/docs/runbooks.md +380 -0
  28. package/docs/state.md +13 -7
  29. package/docs/ubuntu-sync.md +7 -6
  30. package/examples/fleet.json +19 -1
  31. package/llms.txt +2 -0
  32. package/mise.toml +7 -0
  33. package/package.json +2 -2
  34. package/schema/check-ids.json +522 -0
  35. package/schema/fleet.schema.json +178 -1
  36. package/schema/output/check.schema.json +23 -0
  37. package/schema/output/error.schema.json +14 -0
  38. package/schema/output/fleet-report.schema.json +79 -0
  39. package/schema/output/fleet-sync.schema.json +112 -0
  40. package/schema/output/report.schema.json +38 -0
  41. package/src/auth-checks.ts +3 -0
  42. package/src/cli/agent-guide.ts +5 -3
  43. package/src/cli/fleet-report.ts +126 -0
  44. package/src/cli/fleet-sync-manager.ts +11 -0
  45. package/src/cli/fleet-sync-plan.ts +200 -0
  46. package/src/cli/fleet-sync-remote.ts +3 -1
  47. package/src/cli/fleet-sync-schedule.ts +142 -35
  48. package/src/cli/fleet-sync.ts +90 -8
  49. package/src/cli/fleet-watch.ts +198 -0
  50. package/src/cli/fleet.ts +4 -0
  51. package/src/cli/register-fleet.ts +51 -0
  52. package/src/cli/registry.ts +13 -0
  53. package/src/cli/schedule-logs.ts +36 -0
  54. package/src/clock.ts +63 -0
  55. package/src/definition.ts +142 -5
  56. package/src/git-identity.ts +160 -0
  57. package/src/machine-health.ts +51 -4
  58. package/src/manager-health.ts +205 -0
  59. package/src/manager-sync.ts +12 -2
  60. package/src/monitoring/hub-backup.ts +63 -17
  61. package/src/monitoring/manager-hub.ts +44 -2
  62. package/src/node-converge-linux.ts +16 -5
  63. package/src/notify.ts +239 -0
  64. package/src/remote-bootstrap.ts +87 -25
  65. package/src/remote-operation.ts +213 -0
  66. package/src/schedule-check.ts +40 -0
  67. package/src/secrets.ts +26 -8
  68. package/src/ssh.ts +10 -2
  69. package/src/state/history.ts +172 -0
  70. package/src/state/store.ts +11 -4
  71. package/src/tailscale.ts +51 -0
  72. package/src/toolchain-checks.ts +8 -3
  73. package/src/worker-capability-checks.ts +167 -0
  74. package/src/worker-capacity.ts +19 -7
  75. package/src/worker-host-checks.ts +32 -0
  76. package/src/worker-policy.ts +33 -0
  77. package/src/worker-readiness.ts +10 -1
@@ -0,0 +1,522 @@
1
+ {
2
+ "$comment": "Every check ID dev-fleet reports, and what a passing check means. A * stands for a name (an agent, a tool, a phase). features/rules/contracts.feature fails when the code reports an ID this registry lacks, or this registry names one the code no longer reports.",
3
+ "version": 1,
4
+ "checks": [
5
+ {
6
+ "id": "accounts:native-login",
7
+ "meaning": "This machine holds no provider login of its own outside the proxy."
8
+ },
9
+ {
10
+ "id": "accounts:roster-current",
11
+ "meaning": "This machine offers exactly the accounts of the proxy's current account roster."
12
+ },
13
+ {
14
+ "id": "accounts:verification",
15
+ "meaning": "The provider accounts this machine offers were verified; fails when verification could not run."
16
+ },
17
+ {
18
+ "id": "agent:*",
19
+ "meaning": "A coding agent CLI is installed at its pinned version on this machine."
20
+ },
21
+ {
22
+ "id": "agent:*:*:*",
23
+ "meaning": "A coding agent launches with its fleet profile on this machine."
24
+ },
25
+ {
26
+ "id": "agent:*:removed-*:session",
27
+ "meaning": "This machine offers no agent instance for an account the proxy no longer holds."
28
+ },
29
+ {
30
+ "id": "agent:*:session",
31
+ "meaning": "The shared account of a coding agent is signed in and usable."
32
+ },
33
+ {
34
+ "id": "agent:*:version",
35
+ "meaning": "A coding agent runs the version the fleet pins."
36
+ },
37
+ {
38
+ "id": "agent:profiles",
39
+ "meaning": "The fleet's agent profiles are written on this machine."
40
+ },
41
+ {
42
+ "id": "agent:service-environment",
43
+ "meaning": "The environment agent services start with is complete."
44
+ },
45
+ {
46
+ "id": "agent:verification",
47
+ "meaning": "Every coding agent was verified; fails when verification could not run."
48
+ },
49
+ {
50
+ "id": "auth:*",
51
+ "meaning": "A required login or capability works in this process context."
52
+ },
53
+ {
54
+ "id": "auth:toolchain",
55
+ "meaning": "The pinned toolchain, dependencies and Docker could be checked."
56
+ },
57
+ {
58
+ "id": "auth:vault",
59
+ "meaning": "This machine has its own Vault session."
60
+ },
61
+ {
62
+ "id": "beszel:*",
63
+ "meaning": "A monitoring (Beszel) check of this machine."
64
+ },
65
+ {
66
+ "id": "beszel:access",
67
+ "meaning": "The monitoring dashboard answers privately."
68
+ },
69
+ {
70
+ "id": "beszel:backup",
71
+ "meaning": "The monitoring hub's data is backed up."
72
+ },
73
+ {
74
+ "id": "beszel:disk",
75
+ "meaning": "The monitoring hub's disk use could be verified."
76
+ },
77
+ {
78
+ "id": "beszel:enrollment",
79
+ "meaning": "This machine is enrolled in the monitoring hub."
80
+ },
81
+ {
82
+ "id": "beszel:hub",
83
+ "meaning": "The monitoring hub runs on the manager."
84
+ },
85
+ {
86
+ "id": "beszel:hub-connection",
87
+ "meaning": "The monitoring agent reaches the hub."
88
+ },
89
+ {
90
+ "id": "beszel:installation",
91
+ "meaning": "The monitoring agent is installed at its pinned version."
92
+ },
93
+ {
94
+ "id": "beszel:lock",
95
+ "meaning": "Monitoring changes could take the machine's operation lock."
96
+ },
97
+ {
98
+ "id": "beszel:operation",
99
+ "meaning": "The monitoring operation completed."
100
+ },
101
+ {
102
+ "id": "beszel:protocol",
103
+ "meaning": "The machine's monitoring evidence is a valid fleet document."
104
+ },
105
+ {
106
+ "id": "beszel:public-endpoint",
107
+ "meaning": "The public monitoring dashboard answers."
108
+ },
109
+ {
110
+ "id": "beszel:public-viewer",
111
+ "meaning": "The public read-only viewer account works."
112
+ },
113
+ {
114
+ "id": "beszel:service",
115
+ "meaning": "The monitoring agent service runs."
116
+ },
117
+ {
118
+ "id": "bootstrap:*",
119
+ "meaning": "A phase of the remote bootstrap (lock, resources, source-transfer, prerequisites, source-verification, toolchain, configuration and others) completed."
120
+ },
121
+ {
122
+ "id": "bootstrap:attached",
123
+ "meaning": "The manager followed this machine's running operation of the same revision and reports its result."
124
+ },
125
+ {
126
+ "id": "bootstrap:exit",
127
+ "meaning": "The remote bootstrap exited without failure."
128
+ },
129
+ {
130
+ "id": "bootstrap:privilege",
131
+ "meaning": "The development account may use sudo without a password."
132
+ },
133
+ {
134
+ "id": "bootstrap:protocol",
135
+ "meaning": "The remote bootstrap answered with a valid fleet document."
136
+ },
137
+ {
138
+ "id": "configuration:apply",
139
+ "meaning": "The node's configuration (agent profiles, launcher) was applied."
140
+ },
141
+ {
142
+ "id": "configuration:operation",
143
+ "meaning": "The remote configuration operation completed."
144
+ },
145
+ {
146
+ "id": "enrollment:connection",
147
+ "meaning": "The manager has an enrolled connection to this worker."
148
+ },
149
+ {
150
+ "id": "fleet:enrollment:*",
151
+ "meaning": "A declared worker has a verified SSH and checkout registration."
152
+ },
153
+ {
154
+ "id": "fleet:probe",
155
+ "meaning": "The remote probe could be prepared and completed."
156
+ },
157
+ {
158
+ "id": "fleet:registration",
159
+ "meaning": "The machine is registered in the roster."
160
+ },
161
+ {
162
+ "id": "fleet:roster",
163
+ "meaning": "A fleet roster is configured."
164
+ },
165
+ {
166
+ "id": "git:clean",
167
+ "meaning": "The checkout has no uncommitted changes."
168
+ },
169
+ {
170
+ "id": "git:configuration",
171
+ "meaning": "The fleet's Git identity and credential helper were written on this node."
172
+ },
173
+ {
174
+ "id": "login:*",
175
+ "meaning": "A native per-machine login is in place."
176
+ },
177
+ {
178
+ "id": "macos:release",
179
+ "meaning": "The manager runs a supported macOS release."
180
+ },
181
+ {
182
+ "id": "manager:docker",
183
+ "meaning": "The manager runs the pinned Docker Desktop."
184
+ },
185
+ {
186
+ "id": "manager:identity",
187
+ "meaning": "This machine is the declared fleet manager."
188
+ },
189
+ {
190
+ "id": "manager:power",
191
+ "meaning": "The manager never sleeps on AC power."
192
+ },
193
+ {
194
+ "id": "manager:preflight",
195
+ "meaning": "fleet-sync could start on the manager; its summary names the reason when not."
196
+ },
197
+ {
198
+ "id": "manager:schedule",
199
+ "meaning": "The manager's schedule converged the fleet within two of its intervals."
200
+ },
201
+ {
202
+ "id": "notify:configured",
203
+ "meaning": "Every notification target fleet.json names has its address available as a secret."
204
+ },
205
+ {
206
+ "id": "platform:unsupported",
207
+ "meaning": "The machine runs a supported operating system."
208
+ },
209
+ {
210
+ "id": "provider:*:authentication",
211
+ "meaning": "A proxy provider authenticates unattended."
212
+ },
213
+ {
214
+ "id": "provider:*:inference",
215
+ "meaning": "A proxy provider answers a bounded inference round trip."
216
+ },
217
+ {
218
+ "id": "provider:verification",
219
+ "meaning": "Every proxy provider was verified; fails when verification could not run."
220
+ },
221
+ {
222
+ "id": "proxy:*",
223
+ "meaning": "A phase of the CLI proxy's reconciliation completed."
224
+ },
225
+ {
226
+ "id": "proxy:account:*",
227
+ "meaning": "A provider has at least one usable account signed in on the CLI proxy."
228
+ },
229
+ {
230
+ "id": "proxy:configuration",
231
+ "meaning": "The CLI proxy's configuration was reconciled."
232
+ },
233
+ {
234
+ "id": "proxy:reachable-from",
235
+ "meaning": "This machine reaches the CLI proxy, and how fast."
236
+ },
237
+ {
238
+ "id": "repair:*",
239
+ "meaning": "An automated repair completed."
240
+ },
241
+ {
242
+ "id": "repair:inputs",
243
+ "meaning": "The checkout inputs are unchanged since the diagnostics a repair plan used."
244
+ },
245
+ {
246
+ "id": "repair:operation",
247
+ "meaning": "A repair could be prepared and completed."
248
+ },
249
+ {
250
+ "id": "repair:recheck",
251
+ "meaning": "Diagnostics completed again after a repair."
252
+ },
253
+ {
254
+ "id": "repair:workspace",
255
+ "meaning": "A complete checkout exists for repairs."
256
+ },
257
+ {
258
+ "id": "rollout:evidence",
259
+ "meaning": "A worker's rollout produced verification evidence."
260
+ },
261
+ {
262
+ "id": "rollout:operation",
263
+ "meaning": "The remote rollout operation completed."
264
+ },
265
+ {
266
+ "id": "rollout:prerequisites",
267
+ "meaning": "A worker met the rollout's prerequisites."
268
+ },
269
+ {
270
+ "id": "rollout:promotion",
271
+ "meaning": "The canary proved the revision, so promotion to this worker went ahead."
272
+ },
273
+ {
274
+ "id": "source:bootstrap",
275
+ "meaning": "The approved bootstrap source is available on the manager."
276
+ },
277
+ {
278
+ "id": "ssh:agent",
279
+ "meaning": "The SSH agent exposes at least one identity."
280
+ },
281
+ {
282
+ "id": "ssh:auth",
283
+ "meaning": "SSH key or agent authentication succeeded."
284
+ },
285
+ {
286
+ "id": "ssh:disconnected",
287
+ "meaning": "The SSH session was not lost while an operation ran."
288
+ },
289
+ {
290
+ "id": "ssh:dns",
291
+ "meaning": "The SSH host name resolved."
292
+ },
293
+ {
294
+ "id": "ssh:fresh-session",
295
+ "meaning": "A fresh, host-key-verified SSH session succeeded."
296
+ },
297
+ {
298
+ "id": "ssh:host-key",
299
+ "meaning": "The worker's SSH host key is known and unchanged."
300
+ },
301
+ {
302
+ "id": "ssh:missing",
303
+ "meaning": "The local SSH client could be started."
304
+ },
305
+ {
306
+ "id": "ssh:network",
307
+ "meaning": "The SSH endpoint is reachable."
308
+ },
309
+ {
310
+ "id": "ssh:probe",
311
+ "meaning": "A remote probe over SSH succeeded."
312
+ },
313
+ {
314
+ "id": "ssh:protocol",
315
+ "meaning": "The remote answer is a supported fleet document."
316
+ },
317
+ {
318
+ "id": "ssh:runtime",
319
+ "meaning": "The remote workspace and runtime exist for non-login SSH sessions."
320
+ },
321
+ {
322
+ "id": "ssh:session",
323
+ "meaning": "A noninteractive SSH session and probe succeeded."
324
+ },
325
+ {
326
+ "id": "ssh:tailscale-check",
327
+ "meaning": "Tailscale SSH did not require interactive reauthentication."
328
+ },
329
+ {
330
+ "id": "ssh:timeout",
331
+ "meaning": "SSH and the remote probe finished within their deadline."
332
+ },
333
+ {
334
+ "id": "state:*",
335
+ "meaning": "A document of the fleet state (definition, roster, enrollment) is stored."
336
+ },
337
+ {
338
+ "id": "state:bucket",
339
+ "meaning": "A bucket for the fleet state is configured and reachable."
340
+ },
341
+ {
342
+ "id": "state:replica",
343
+ "meaning": "The bucket holds this manager's fleet state."
344
+ },
345
+ {
346
+ "id": "t3:api",
347
+ "meaning": "The local T3 API answers."
348
+ },
349
+ {
350
+ "id": "t3:end-to-end",
351
+ "meaning": "T3 relay and peer access, which need an operator test."
352
+ },
353
+ {
354
+ "id": "t3:manager-endpoint",
355
+ "meaning": "The manager reaches the worker's private T3 endpoint."
356
+ },
357
+ {
358
+ "id": "t3:manager-origin",
359
+ "meaning": "The manager's T3 origin is configured."
360
+ },
361
+ {
362
+ "id": "t3:models",
363
+ "meaning": "T3 offers only the declared models for every account instance the fleet manages."
364
+ },
365
+ {
366
+ "id": "t3:paired-access",
367
+ "meaning": "The manager's T3 is linked to this worker."
368
+ },
369
+ {
370
+ "id": "t3:policy-loaded",
371
+ "meaning": "The running T3 loaded the managed policy."
372
+ },
373
+ {
374
+ "id": "t3:policy-staged",
375
+ "meaning": "The managed T3 policy is installed."
376
+ },
377
+ {
378
+ "id": "t3:prerequisites",
379
+ "meaning": "The T3 baseline prerequisites are present."
380
+ },
381
+ {
382
+ "id": "t3:private-route",
383
+ "meaning": "T3's private HTTPS route is served."
384
+ },
385
+ {
386
+ "id": "t3:profile",
387
+ "meaning": "The declared T3 settings are in place on this machine."
388
+ },
389
+ {
390
+ "id": "t3:provider-names",
391
+ "meaning": "T3 lists the fleet's provider names."
392
+ },
393
+ {
394
+ "id": "t3:providers",
395
+ "meaning": "T3's provider instances are the declared ones."
396
+ },
397
+ {
398
+ "id": "t3:service",
399
+ "meaning": "The pinned T3 app runs."
400
+ },
401
+ {
402
+ "id": "t3:settings",
403
+ "meaning": "T3 settings are readable."
404
+ },
405
+ {
406
+ "id": "t3:updates",
407
+ "meaning": "T3's own updater is off, as the fleet's policy declares."
408
+ },
409
+ {
410
+ "id": "t3:version",
411
+ "meaning": "This machine runs the T3 version the fleet pins."
412
+ },
413
+ {
414
+ "id": "tailscale:configuration",
415
+ "meaning": "Tailscale is configured as declared."
416
+ },
417
+ {
418
+ "id": "tailscale:discovery",
419
+ "meaning": "Tailscale computers could be discovered."
420
+ },
421
+ {
422
+ "id": "tailscale:enrolled-identity",
423
+ "meaning": "The Tailscale identity matches the enrollment."
424
+ },
425
+ {
426
+ "id": "tailscale:identity",
427
+ "meaning": "A machine's Tailscale identity is unambiguous."
428
+ },
429
+ {
430
+ "id": "tailscale:membership",
431
+ "meaning": "A registered machine is in the visible tailnet."
432
+ },
433
+ {
434
+ "id": "tailscale:online",
435
+ "meaning": "Tailscale is online on this machine."
436
+ },
437
+ {
438
+ "id": "tailscale:reachability",
439
+ "meaning": "The machine is online in the tailnet."
440
+ },
441
+ {
442
+ "id": "tool:*",
443
+ "meaning": "A pinned tool, or the global mise configuration (tool:global-mise-config), is as the revision declares."
444
+ },
445
+ {
446
+ "id": "ubuntu:baseline",
447
+ "meaning": "The Ubuntu baseline policy is applied."
448
+ },
449
+ {
450
+ "id": "ubuntu:boot-policy",
451
+ "meaning": "The no-sleep and session boot policy is active."
452
+ },
453
+ {
454
+ "id": "ubuntu:prerequisites",
455
+ "meaning": "The Ubuntu prerequisites are installed."
456
+ },
457
+ {
458
+ "id": "ubuntu:release",
459
+ "meaning": "The worker runs the supported Ubuntu release."
460
+ },
461
+ {
462
+ "id": "ubuntu:resource-safety",
463
+ "meaning": "The OOM killer, disk guard and resource caps are active."
464
+ },
465
+ {
466
+ "id": "vscode:forwarding",
467
+ "meaning": "VS Code Remote-SSH forwarding, which needs an operator test."
468
+ },
469
+ {
470
+ "id": "worker:*",
471
+ "meaning": "A worker readiness gate."
472
+ },
473
+ {
474
+ "id": "worker:capacity",
475
+ "meaning": "CPU, memory and disk evidence is available."
476
+ },
477
+ {
478
+ "id": "worker:capacity:*",
479
+ "meaning": "A worker meets one capacity floor (load, memory, disk)."
480
+ },
481
+ {
482
+ "id": "worker:desired-source",
483
+ "meaning": "The worker runs the declared revision."
484
+ },
485
+ {
486
+ "id": "worker:github-principal",
487
+ "meaning": "The worker's GitHub login is the declared account."
488
+ },
489
+ {
490
+ "id": "worker:power-loss-recovery",
491
+ "meaning": "The worker powers on after AC loss."
492
+ },
493
+ {
494
+ "id": "worker:proxy-authentication",
495
+ "meaning": "The worker authenticates to the shared proxy."
496
+ },
497
+ {
498
+ "id": "worker:proxy-singleton",
499
+ "meaning": "The worker is a proxy client, not a second gateway."
500
+ },
501
+ {
502
+ "id": "worker:readiness",
503
+ "meaning": "The worker readiness checks could run."
504
+ },
505
+ {
506
+ "id": "worker:service-recovery",
507
+ "meaning": "Worker services recover after failure."
508
+ },
509
+ {
510
+ "id": "worker:vault-renewal",
511
+ "meaning": "The worker renews its Vault identity unattended."
512
+ },
513
+ {
514
+ "id": "workstation:configuration",
515
+ "meaning": "The devfleet launcher is installed and linked."
516
+ },
517
+ {
518
+ "id": "workstation:installation",
519
+ "meaning": "The devfleet launcher could be installed."
520
+ }
521
+ ]
522
+ }