@crvouga/homelab 0.23.13 → 0.24.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 (177) hide show
  1. package/.mise/locks/npm-vercel/{68.0.0 → 68.2.0}/aube-lock.yaml +73 -297
  2. package/.mise/locks/npm-vercel/{68.0.0 → 68.2.0}/package.json +1 -1
  3. package/.mise/locks/npm-wrangler/{4.169.0 → 4.170.0}/aube-lock.yaml +42 -42
  4. package/.mise/locks/npm-wrangler/{4.169.0 → 4.170.0}/package.json +1 -1
  5. package/README.md +54 -76
  6. package/ansible/ubuntu/agent-tool.py +106 -1
  7. package/ansible/ubuntu/heavy.py +142 -0
  8. package/ansible/ubuntu/idle-reboot.py +125 -0
  9. package/ansible/ubuntu/policy.json +58 -3
  10. package/ansible/ubuntu/t3-desktop.yml +7 -0
  11. package/ansible/ubuntu/t3-hang-snapshot.sh +75 -0
  12. package/ansible/ubuntu/t3-headless.yml +7 -0
  13. package/ansible/ubuntu/t3-health.sh +71 -3
  14. package/ansible/ubuntu/t3-policy.yml +14 -5
  15. package/ansible/ubuntu/tasks/packages.yml +2 -0
  16. package/ansible/ubuntu/tasks/recovery.yml +16 -2
  17. package/ansible/ubuntu/tasks/resources.yml +25 -2
  18. package/ansible/ubuntu/tasks/unattended-upgrades.yml +24 -6
  19. package/ansible/ubuntu/tasks/updates.yml +59 -0
  20. package/ansible/ubuntu/wip-guard.py +141 -14
  21. package/bootstrap/doctor.ts +0 -4
  22. package/bootstrap/project-action.sh +4 -5
  23. package/bootstrap/shell-path.ts +17 -19
  24. package/cliproxy/README.md +5 -6
  25. package/cliproxy/config.template.yaml +1 -15
  26. package/cliproxy/docs/health-workflow.example.yml +6 -6
  27. package/cliproxy/docs/model-health.md +8 -8
  28. package/cliproxy/scripts/accounts.py +3 -4
  29. package/cliproxy/scripts/fleet_sync.py +2 -13
  30. package/cliproxy/scripts/ops +3 -21
  31. package/docs/authentication.md +21 -26
  32. package/docs/convergence.md +28 -32
  33. package/docs/declared.md +30 -31
  34. package/docs/durability.md +9 -0
  35. package/docs/github.md +0 -9
  36. package/docs/machine-setup.md +16 -17
  37. package/docs/manager-recovery.md +0 -2
  38. package/docs/operations.md +12 -11
  39. package/docs/releasing.md +18 -21
  40. package/docs/runbooks.md +22 -78
  41. package/docs/support-matrix.md +1 -1
  42. package/docs/ubuntu-sync.md +71 -65
  43. package/docs/worker-contract.md +112 -15
  44. package/examples/fleet.json +0 -1
  45. package/llms.txt +0 -2
  46. package/mise.lock +206 -780
  47. package/mise.toml +12 -27
  48. package/package.json +5 -6
  49. package/schema/check-ids.json +41 -482
  50. package/schema/fleet.schema.json +6 -57
  51. package/schema/roster.schema.json +0 -2
  52. package/src/agent-session-limit.ts +2 -7
  53. package/src/auth-checks.ts +1 -3
  54. package/src/check-owners.ts +0 -13
  55. package/src/check-registry.ts +13 -72
  56. package/src/cli/agent-guide.ts +3 -16
  57. package/src/cli/command-index.ts +0 -12
  58. package/src/cli/fleet-sync-manager.ts +4 -146
  59. package/src/cli/fleet-sync-output.ts +1 -4
  60. package/src/cli/fleet-sync-plan.ts +1 -24
  61. package/src/cli/fleet-sync-remote.ts +2 -1
  62. package/src/cli/fleet-sync-vault.ts +1 -2
  63. package/src/cli/fleet-sync.ts +8 -44
  64. package/src/cli/fleet.ts +1 -2
  65. package/src/cli/program.ts +3 -14
  66. package/src/cli/register-fleet.ts +1 -55
  67. package/src/cli/registry.ts +1 -43
  68. package/src/config.ts +0 -2
  69. package/src/definition.ts +8 -83
  70. package/src/fleet-config.ts +1 -1
  71. package/src/ide/definition.ts +2 -29
  72. package/src/ide/super.ts +4 -35
  73. package/src/ide/t3.ts +9 -38
  74. package/src/manager-sync.ts +1 -1
  75. package/src/node-converge-linux.ts +4 -47
  76. package/src/node-converge-shared.ts +1 -22
  77. package/src/{agents/toolchain.ts → pinned-path.ts} +0 -17
  78. package/src/platform/agent-oom-check.ts +104 -0
  79. package/src/platform/t3-policy.ts +23 -36
  80. package/src/platform/t3-service.ts +117 -0
  81. package/src/platform/wip-guard-check.ts +65 -0
  82. package/src/remote-entry.ts +2 -41
  83. package/src/repair-catalog.ts +0 -30
  84. package/src/schedule-check.ts +17 -4
  85. package/src/service-auth.ts +0 -50
  86. package/src/state/litestream.ts +1 -1
  87. package/src/t3/retire-providers.ts +79 -0
  88. package/src/t3/version.ts +1 -1
  89. package/src/transport.ts +2 -6
  90. package/src/types.ts +0 -2
  91. package/src/version-parity.ts +0 -8
  92. package/src/worker-access-checks.ts +0 -75
  93. package/src/worker-host-checks.ts +78 -1
  94. package/src/worker-policy.ts +0 -2
  95. package/src/worker-readiness.ts +2 -0
  96. package/src/worker-sizing.ts +25 -0
  97. package/.mise/locks/azure-cli/2.93.0~a837e014/pyproject.toml +0 -5
  98. package/.mise/locks/azure-cli/2.93.0~a837e014/uv.lock +0 -2841
  99. package/.mise/locks/gemini/0.71.1~84aac8e6/aube-lock.yaml +0 -124
  100. package/.mise/locks/gemini/0.71.1~84aac8e6/package.json +0 -12
  101. package/agents/antigravity-proxy.ts +0 -3
  102. package/agents/audit.md +0 -88
  103. package/agents/bin/agy +0 -10
  104. package/agents/bin/antigravity +0 -10
  105. package/agents/bin/claude +0 -10
  106. package/agents/bin/codex +0 -10
  107. package/agents/bin/grok +0 -10
  108. package/agents/bin/opencode +0 -10
  109. package/agents/claude-proxy +0 -5
  110. package/agents/claude-proxy.ts +0 -3
  111. package/agents/codex-proxy.ts +0 -3
  112. package/agents/grok-proxy.ts +0 -3
  113. package/agents/managed-proxy.ts +0 -109
  114. package/agents/opencode-proxy.ts +0 -3
  115. package/agents/registry.json +0 -209
  116. package/agents/registry.schema.json +0 -149
  117. package/agents/setup.md +0 -158
  118. package/agents/t3.json +0 -40
  119. package/ansible/agents/agents.yml +0 -135
  120. package/ansible/agents/commands.yml +0 -32
  121. package/ansible/agents/receipts.yml +0 -19
  122. package/ansible/agents/templates/antigravity.settings.json.j2 +0 -3
  123. package/ansible/agents/templates/claude.settings.json.j2 +0 -3
  124. package/ansible/agents/templates/codex.config.toml.j2 +0 -11
  125. package/ansible/agents/templates/gemini.settings.json.j2 +0 -14
  126. package/ansible/agents/templates/grok.config.toml.j2 +0 -25
  127. package/ansible/agents/templates/opencode.json.j2 +0 -24
  128. package/ansible/agents/templates/receipt.json.j2 +0 -10
  129. package/ansible/t3/provider-keys.yml +0 -24
  130. package/docs/accounts.md +0 -256
  131. package/src/accounts/checks.ts +0 -226
  132. package/src/accounts/context.ts +0 -77
  133. package/src/accounts/propagate.ts +0 -62
  134. package/src/accounts/roster.ts +0 -112
  135. package/src/accounts/selection.ts +0 -67
  136. package/src/accounts/sessions.ts +0 -354
  137. package/src/agents/account-relay.ts +0 -279
  138. package/src/agents/accounts.ts +0 -94
  139. package/src/agents/admission.ts +0 -65
  140. package/src/agents/audit.ts +0 -77
  141. package/src/agents/cli.ts +0 -13
  142. package/src/agents/command.ts +0 -257
  143. package/src/agents/commands.ts +0 -127
  144. package/src/agents/converge.ts +0 -339
  145. package/src/agents/doctor.ts +0 -107
  146. package/src/agents/errors.ts +0 -2
  147. package/src/agents/files.ts +0 -43
  148. package/src/agents/fleet-verify.ts +0 -195
  149. package/src/agents/launch.ts +0 -361
  150. package/src/agents/native-verify.ts +0 -738
  151. package/src/agents/provider-errors.ts +0 -57
  152. package/src/agents/registry.ts +0 -61
  153. package/src/agents/render.ts +0 -121
  154. package/src/agents/round-trip.ts +0 -192
  155. package/src/agents/secrets.ts +0 -48
  156. package/src/agents/verify-cache.ts +0 -164
  157. package/src/agents/verify.ts +0 -129
  158. package/src/cli/fleet-accounts.ts +0 -294
  159. package/src/cli/fleet-sync-accounts.ts +0 -62
  160. package/src/cli/node-deployment.ts +0 -34
  161. package/src/cli/node-sync.ts +0 -121
  162. package/src/cli/node-t3.ts +0 -35
  163. package/src/cli/t3/command.ts +0 -91
  164. package/src/cli/t3/register.ts +0 -56
  165. package/src/configure.ts +0 -271
  166. package/src/github/copilot.ts +0 -54
  167. package/src/t3/accounts.ts +0 -90
  168. package/src/t3/antigravity.ts +0 -93
  169. package/src/t3/desired.ts +0 -174
  170. package/src/t3/diagnostics.ts +0 -42
  171. package/src/t3/models.ts +0 -354
  172. package/src/t3/names-check.ts +0 -53
  173. package/src/t3/names.ts +0 -155
  174. package/src/t3/plan.ts +0 -106
  175. package/src/t3/provider-keys.ts +0 -49
  176. package/src/t3/providers.ts +0 -102
  177. package/src/t3/reconcile.ts +0 -133
@@ -19,6 +19,7 @@
19
19
  mode: '0755'
20
20
  loop:
21
21
  - t3-health.sh
22
+ - t3-hang-snapshot.sh
22
23
  - t3-listener.py
23
24
  - t3-idle.py
24
25
  - t3-renderers.py
@@ -36,8 +37,11 @@
36
37
  Type=oneshot
37
38
  Environment=T3_RENDERER_HIGH_MIB={{ resourceSafety.rendererHighMiB }} T3_RENDERER_MAX_MIB={{ resourceSafety.rendererMaxMiB }}
38
39
  Environment=T3_RESTART_MAX_DEFERRAL_HOURS={{ t3RestartMaxDeferralHours }}
40
+ Environment=T3_RESTART_BACKOFF_BASE_SECONDS={{ t3Service.restartBackoffBaseSeconds }} T3_RESTART_BACKOFF_MAX_SECONDS={{ t3Service.restartBackoffMaxSeconds }}
41
+ Environment=T3_WATCHDOG_LOG_LINES={{ t3Service.watchdogLogLines }} T3_HANG_SNAPSHOTS_KEPT={{ t3Service.hangSnapshotsKept }}
39
42
  ExecStart=/bin/sh /usr/local/lib/personal-fleet/t3-health.sh
40
- TimeoutStartSec=90
43
+ # Longer than a restart: the stop timeout of the T3 unit plus its start.
44
+ TimeoutStartSec={{ t3Service.watchdogTimeoutSeconds }}
41
45
  - name: Declare persistent service recovery checks
42
46
  ansible.builtin.copy:
43
47
  dest: '{{ development_home }}/.config/systemd/user/personal-worker-recovery.timer'
@@ -78,7 +82,15 @@
78
82
  CPUWeight=1
79
83
  IOWeight=1
80
84
  IOSchedulingClass=idle
81
- ExecStart=/usr/bin/python3 {{ development_source }}/ansible/ubuntu/wip-guard.py --root {{ development_home }}/.t3/worktrees --node %l
85
+ # A run is bounded in time (the budget resumes on the next tick), memory
86
+ # and processes; its page cache is reclaimed at MemoryHigh instead of
87
+ # competing with T3 and the agents.
88
+ MemoryHigh={{ resourceSafety.wipGuard.memoryHighMiB }}M
89
+ MemoryMax={{ resourceSafety.wipGuard.memoryMaxMiB }}M
90
+ MemorySwapMax=0
91
+ TasksMax={{ resourceSafety.wipGuard.tasks }}
92
+ StateDirectory=personal/wip-guard
93
+ ExecStart=/usr/bin/python3 {{ development_source }}/ansible/ubuntu/wip-guard.py --root {{ development_home }}/.t3/worktrees --node %l --budget {{ resourceSafety.wipGuard.budgetSeconds }} --state %S/personal/wip-guard
82
94
  TimeoutStartSec=600
83
95
  - name: Declare how often work in progress is saved
84
96
  ansible.builtin.copy:
@@ -91,6 +103,8 @@
91
103
  [Timer]
92
104
  OnBootSec=5min
93
105
  OnUnitActiveSec=15min
106
+ # Do not line up with the other timers of the worker.
107
+ RandomizedDelaySec={{ resourceSafety.wipGuard.randomizedDelaySeconds }}
94
108
  Persistent=true
95
109
  [Install]
96
110
  WantedBy=timers.target
@@ -168,9 +168,14 @@
168
168
  # Managed by personal converge. Applies to every t3code-*.scope T3 starts for an agent.
169
169
  # OOMPolicy=continue permits surviving processes to continue; it cannot protect the provider itself.
170
170
  # IOAccounting=yes: the pressure guard needs each agent's io.stat to tell a writer from a reader it blocks.
171
+ # MemoryHigh sits below MemoryMax: a heavy build is slowed by reclaim
172
+ # before the kernel kills one of its processes. CPUQuota keeps one
173
+ # session from taking every core (agentCpu, sized from the core count).
171
174
  [Scope]
175
+ MemoryHigh={{ resourceSafety.agentMemoryHigh }}
172
176
  MemoryMax={{ resourceSafety.agentMemoryMax }}
173
177
  MemorySwapMax={{ resourceSafety.agentSwapMax }}
178
+ CPUQuota={{ [worker_size.cpus | int * resourceSafety.agentCpu.scopePercentOfCores, resourceSafety.agentCpu.minScopeCpus * 100] | max }}%
174
179
  OOMPolicy=continue
175
180
  IOAccounting=yes
176
181
  register: agent_policy
@@ -208,14 +213,25 @@
208
213
  owner: root
209
214
  group: root
210
215
  mode: '0644'
211
- loop: [agent-tool.py, agent-tool.bash]
216
+ loop: [agent-tool.py, agent-tool.bash, heavy.py]
217
+ - name: Install the heavy tool queue where agents find it on PATH
218
+ ansible.builtin.copy:
219
+ dest: /usr/local/bin/homelab-heavy
220
+ owner: root
221
+ group: root
222
+ mode: '0755'
223
+ content: |
224
+ #!/bin/sh
225
+ # Managed by personal converge. Queues one heavy tool behind a worker-wide
226
+ # number of slots, instead of letting every agent start one at once.
227
+ exec /usr/bin/python3 -I -B /usr/local/lib/personal-fleet-agent-tool/heavy.py "$@"
212
228
  - name: Declare shell tool admission budgets
213
229
  ansible.builtin.copy:
214
230
  dest: /usr/local/lib/personal-fleet-agent-tool/agent-tool-policy.json
215
231
  owner: root
216
232
  group: root
217
233
  mode: '0644'
218
- content: '{{ resourceSafety.agentTool | to_nice_json }}'
234
+ content: "{{ resourceSafety.agentTool | combine({'agentCpu': resourceSafety.agentCpu, 'heavy': resourceSafety.heavyTools}) | to_nice_json }}"
219
235
  - name: Charge automatically named systemd-run jobs to the shared agent budget
220
236
  ansible.builtin.copy:
221
237
  dest: '/etc/systemd/user/run-.{{ item | lower }}.d/60-personal-fleet.conf'
@@ -226,8 +242,10 @@
226
242
  # Managed by personal converge. Detached builds share the agent budget.
227
243
  [{{ item }}]
228
244
  Slice=app-t3code-agents.slice
245
+ MemoryHigh={{ resourceSafety.agentMemoryHigh }}
229
246
  MemoryMax={{ resourceSafety.agentMemoryMax }}
230
247
  MemorySwapMax={{ resourceSafety.agentSwapMax }}
248
+ CPUQuota={{ [worker_size.cpus | int * resourceSafety.agentCpu.scopePercentOfCores, resourceSafety.agentCpu.minScopeCpus * 100] | max }}%
231
249
  IOAccounting=yes
232
250
  loop: [Service, Scope]
233
251
  register: transient_limits
@@ -244,6 +262,9 @@
244
262
  MemoryMax={{ worker_size.memoryMiB | int * item.max | int // 100 }}M
245
263
  MemorySwapMax={{ resourceSafety.agentSlice.swapMiB }}M
246
264
  TasksMax={{ resourceSafety.agentSlice.tasks }}
265
+ # All agents together leave the reserved cores to T3 and the system
266
+ # (the thread slices are bounded by it; an empty quota is no quota).
267
+ CPUQuota={{ item.cpuQuota }}
247
268
  CPUWeight={{ resourceSafety.agentSlice.weight }}
248
269
  IOWeight={{ resourceSafety.agentSlice.weight }}
249
270
  # Reclaim at MemoryHigh must not terminate whole sessions. Host-level
@@ -253,9 +274,11 @@
253
274
  - unit: app-t3code-agents
254
275
  high: '{{ resourceSafety.agentSlice.highPercent }}'
255
276
  max: '{{ resourceSafety.agentSlice.maxPercent }}'
277
+ cpuQuota: '{{ [(worker_size.cpus | int - resourceSafety.agentCpu.reservedCpus) * 100, 100] | max }}%'
256
278
  - unit: app-t3code-agents-
257
279
  high: '{{ resourceSafety.agentSlice.threadHighPercent }}'
258
280
  max: '{{ resourceSafety.agentSlice.threadMaxPercent }}'
281
+ cpuQuota: ''
259
282
  register: agent_slices
260
283
  - name: Find property overrides for agent slices
261
284
  become: true
@@ -1,9 +1,11 @@
1
1
  ---
2
- # Ubuntu installs security updates by itself, and they keep flowing: a pin is
3
- # a minimum, never a hold. What runs unattended is declared here so it is
4
- # known: security updates only, never a reboot, never a removal. The fleet's
5
- # own file sorts after the package's 50unattended-upgrades and replaces its
6
- # origins.
2
+ # A worker is cattle: Ubuntu keeps it up to date by itself, and a pin is a
3
+ # minimum, never a hold. What runs unattended is declared here so it is known:
4
+ # every update of Ubuntu's own archive (security and regular updates, and the
5
+ # ESM security archives), never a reboot from here (tasks/updates.yml reboots
6
+ # an idle worker), never a removal. Third-party archives (Docker, Tailscale)
7
+ # are not listed: those stay at the pins in policy.json. The fleet's own file
8
+ # sorts after the package's 50unattended-upgrades and replaces its origins.
7
9
  - name: Declare which updates Ubuntu installs unattended
8
10
  ansible.builtin.copy:
9
11
  dest: /etc/apt/apt.conf.d/52personal-fleet-unattended-upgrades
@@ -17,8 +19,24 @@
17
19
  #clear Unattended-Upgrade::Allowed-Origins;
18
20
  #clear Unattended-Upgrade::Origins-Pattern;
19
21
  Unattended-Upgrade::Allowed-Origins {
20
- "${distro_id}:${distro_codename}-security";
22
+ {% for origin in updates.origins %}
23
+ "${distro_id}:${distro_codename}-{{ origin }}";
24
+ {% endfor %}
25
+ {% if updates.esm %}
26
+ "${distro_id}ESMApps:${distro_codename}-apps-security";
27
+ "${distro_id}ESM:${distro_codename}-infra-security";
28
+ {% endif %}
21
29
  };
30
+ Unattended-Upgrade::MinimalSteps "true";
22
31
  Unattended-Upgrade::Automatic-Reboot "false";
23
32
  Unattended-Upgrade::Remove-Unused-Dependencies "false";
24
33
  Unattended-Upgrade::Remove-New-Unused-Dependencies "false";
34
+ - name: Run the timers that refresh and install updates
35
+ ansible.builtin.systemd_service:
36
+ name: '{{ item }}'
37
+ masked: false
38
+ enabled: true
39
+ state: started
40
+ loop:
41
+ - apt-daily.timer
42
+ - apt-daily-upgrade.timer
@@ -0,0 +1,59 @@
1
+ ---
2
+ # Kernel and library updates apply only after a reboot. An idle worker reboots
3
+ # itself (ansible/ubuntu/idle-reboot.py), so nobody has to: it waits while an
4
+ # agent turn runs or ran recently, and an upgrade is never cut off. The script
5
+ # and the idle probe it asks run from a copy outside every revision, because a
6
+ # synced revision is pruned and the unit must not name a file that is gone.
7
+ - name: Create the directory of the installed worker scripts
8
+ ansible.builtin.file:
9
+ path: /usr/local/lib/personal-fleet
10
+ state: directory
11
+ owner: root
12
+ group: root
13
+ mode: '0755'
14
+ - name: Install the idle reboot and the probe it asks outside the revision
15
+ ansible.builtin.copy:
16
+ src: '{{ playbook_dir }}/{{ item }}'
17
+ dest: '/usr/local/lib/personal-fleet/{{ item }}'
18
+ owner: root
19
+ group: root
20
+ mode: '0755'
21
+ loop:
22
+ - idle-reboot.py
23
+ - t3-idle.py
24
+ - name: Declare the idle reboot service and its timer
25
+ ansible.builtin.copy:
26
+ dest: '{{ item.dest }}'
27
+ owner: root
28
+ group: root
29
+ mode: '0644'
30
+ content: '{{ item.content }}'
31
+ loop:
32
+ - dest: /etc/systemd/system/personal-fleet-idle-reboot.service
33
+ content: |
34
+ # Managed by personal converge: ansible/ubuntu/idle-reboot.py
35
+ [Unit]
36
+ Description=Reboot the worker to finish updates while it runs no agent turn
37
+ [Service]
38
+ Type=oneshot
39
+ ExecStart=/usr/bin/python3 -I -B /usr/local/lib/personal-fleet/idle-reboot.py --t3-idle /usr/local/lib/personal-fleet/t3-idle.py --state {{ development_home }}/.t3/userdata/statev2.sqlite --idle-minutes {{ updates.idleReboot.idleMinutes }} --min-uptime-minutes {{ updates.idleReboot.minUptimeMinutes }}
40
+ TimeoutStartSec=5min
41
+ - dest: /etc/systemd/system/personal-fleet-idle-reboot.timer
42
+ content: |
43
+ # Managed by personal converge: ansible/ubuntu/idle-reboot.py
44
+ [Unit]
45
+ Description=Look every {{ updates.idleReboot.intervalMinutes }} minutes for an idle worker that needs a reboot
46
+ [Timer]
47
+ OnBootSec={{ updates.idleReboot.minUptimeMinutes }}min
48
+ OnUnitActiveSec={{ updates.idleReboot.intervalMinutes }}min
49
+ [Install]
50
+ WantedBy=timers.target
51
+ loop_control:
52
+ label: '{{ item.dest }}'
53
+ register: idle_reboot_units
54
+ - name: Schedule the idle reboot
55
+ ansible.builtin.systemd_service:
56
+ name: personal-fleet-idle-reboot.timer
57
+ daemon_reload: '{{ idle_reboot_units.changed }}'
58
+ enabled: true
59
+ state: started
@@ -18,18 +18,38 @@ holds the ref, the same ref is set in the repository itself, so the disk GC
18
18
  can tell that the work is saved without asking the remote. Recover with
19
19
  `git fetch origin 'refs/recovery/*:refs/recovery/*'`.
20
20
 
21
- Every decision is one JSON line on stdout.
21
+ A run costs about nothing when nothing changed, however many worktrees exist:
22
+
23
+ - The snapshot is built in a copy of the worktree's own index, so Git's stat
24
+ cache is valid and only files that changed are read and hashed. An empty
25
+ index would make `git add --all` read every tracked file of every worktree.
26
+ - A fingerprint (HEAD, the changed paths and their size and mtime) is kept per
27
+ worktree once its work is saved; a worktree whose fingerprint is unchanged
28
+ is skipped after one `git status`. The fingerprints are a disposable cache,
29
+ and a day old at most: without them every worktree is saved again, which is
30
+ always safe.
31
+ - A run has a time budget. Worktrees are taken in a stable order and the next
32
+ run resumes after the last one that finished, so a busy worker spends a
33
+ bounded amount of work per tick and no worktree starves.
34
+
35
+ Every decision is one JSON line on stdout, and so is the run: its duration,
36
+ the worktrees seen, visited and left for the next run, and its peak memory.
22
37
 
23
38
  Usage: wip-guard.py --root DIR [--root DIR ...] [--node ID] [--remote NAME]
24
- [--max-depth N] [--dry-run]
39
+ [--max-depth N] [--budget SECONDS] [--state DIR]
40
+ [--dry-run]
25
41
  """
26
42
  import argparse
43
+ import hashlib
27
44
  import json
28
45
  import os
29
46
  import re
47
+ import resource
48
+ import shutil
30
49
  import socket
31
50
  import subprocess
32
51
  import tempfile
52
+ import time
33
53
  from pathlib import Path
34
54
 
35
55
  GIT = ['git', '-c', 'safe.directory=*']
@@ -68,18 +88,45 @@ def ref_part(value):
68
88
  return part or 'unnamed'
69
89
 
70
90
 
91
+ def fingerprint(path, head):
92
+ """What identifies the worktree's work: HEAD, the paths that differ from it
93
+ and the size and mtime of each. None when Git cannot tell."""
94
+ status = git(path, '--no-optional-locks', 'status', '--porcelain=v1', '-z',
95
+ '--untracked-files=all')
96
+ if status.returncode != 0:
97
+ return None
98
+ digest = hashlib.sha256(head.encode())
99
+ for entry in status.stdout.split('\0'):
100
+ if not entry:
101
+ continue
102
+ digest.update(entry.encode(errors='surrogateescape'))
103
+ try:
104
+ seen = os.lstat(os.path.join(path, entry[3:]))
105
+ digest.update(b'%d:%d' % (seen.st_size, seen.st_mtime_ns))
106
+ except OSError:
107
+ digest.update(b'absent')
108
+ return digest.hexdigest()
109
+
110
+
71
111
  def snapshot(path):
72
112
  """The worktree's files as one commit on HEAD, or HEAD when clean."""
73
113
  head = git(path, 'rev-parse', '--verify', 'HEAD').stdout.strip()
74
114
  if not head:
75
115
  return None, None
76
116
  with tempfile.TemporaryDirectory() as private:
77
- index = {'GIT_INDEX_FILE': os.path.join(private, 'index')}
78
- if git(path, 'read-tree', 'HEAD', env=index).returncode != 0:
79
- return head, None
80
- if git(path, 'add', '--all', '--', '.', env=index).returncode != 0:
117
+ copy = os.path.join(private, 'index')
118
+ env = {'GIT_INDEX_FILE': copy}
119
+ # The worktree's own index knows each file's size and mtime, so `add`
120
+ # hashes only what changed. Without one, start from HEAD.
121
+ real = git(path, 'rev-parse', '--path-format=absolute', '--git-path', 'index').stdout.strip()
122
+ try:
123
+ shutil.copyfile(real, copy)
124
+ except OSError:
125
+ if git(path, 'read-tree', 'HEAD', env=env).returncode != 0:
126
+ return head, None
127
+ if git(path, 'add', '--all', '--', '.', env=env).returncode != 0:
81
128
  return head, None
82
- tree = git(path, 'write-tree', env=index).stdout.strip()
129
+ tree = git(path, 'write-tree', env=env).stdout.strip()
83
130
  if tree == git(path, 'rev-parse', 'HEAD^{tree}').stdout.strip():
84
131
  return head, head
85
132
  commit = git(path, 'commit-tree', tree, '-p', head, '-m',
@@ -87,13 +134,59 @@ def snapshot(path):
87
134
  return head, commit.stdout.strip() or None
88
135
 
89
136
 
90
- def guard(path, node, remote, dry_run):
137
+ class Stamps:
138
+ """Fingerprints of saved work, one small file per worktree. A cache: losing
139
+ it only costs a full run."""
140
+
141
+ def __init__(self, directory):
142
+ self.directory = Path(directory) if directory else None
143
+ if self.directory:
144
+ try:
145
+ self.directory.mkdir(parents=True, exist_ok=True)
146
+ except OSError:
147
+ self.directory = None
148
+
149
+ def _file(self, name):
150
+ return self.directory / hashlib.sha256(name.encode()).hexdigest()[:32]
151
+
152
+ def get(self, name, max_age=None):
153
+ if not self.directory:
154
+ return None
155
+ try:
156
+ file = self._file(name)
157
+ if max_age is not None and time.time() - file.stat().st_mtime > max_age:
158
+ return None
159
+ return file.read_text().strip()
160
+ except OSError:
161
+ return None
162
+
163
+ def set(self, name, value):
164
+ if not self.directory:
165
+ return
166
+ try:
167
+ self._file(name).write_text(value + '\n')
168
+ except OSError:
169
+ pass
170
+
171
+
172
+ # A saved worktree is saved again after this long even when unchanged, so a
173
+ # recovery ref lost on the remote comes back.
174
+ STAMP_MAX_AGE = 24 * 3600
175
+
176
+
177
+ def guard(path, node, remote, dry_run, stamps):
91
178
  if git(path, 'remote', 'get-url', remote).returncode != 0:
92
179
  return log(worktree=str(path), action='skip', reason='no-remote')
180
+ head = git(path, 'rev-parse', '--verify', 'HEAD').stdout.strip()
181
+ seen = '%s %s' % (node, fingerprint(path, head)) if head else None
182
+ if seen and stamps.get(str(path), STAMP_MAX_AGE) == seen:
183
+ return log(worktree=str(path), action='skip', reason='unchanged')
93
184
  head, commit = snapshot(path)
94
185
  if not commit:
95
186
  return log(worktree=str(path), action='skip', reason='no-commit')
96
187
  if commit == head and git(path, 'branch', '--remotes', '--contains', head).stdout.strip():
188
+ if seen and not dry_run:
189
+ stamps.set(str(path), seen)
97
190
  return log(worktree=str(path), action='skip', reason='clean')
98
191
  branch = git(path, 'symbolic-ref', '--quiet', '--short', 'HEAD').stdout.strip()
99
192
  ref = 'refs/recovery/%s/%s' % (ref_part(node), ref_part(branch or 'detached-' + head[:12]))
@@ -105,23 +198,57 @@ def guard(path, node, remote, dry_run):
105
198
  # a disposable fleet removes a worktree whose work it holds
106
199
  # (disk-gc.py, saved_in_recovery_ref).
107
200
  git(path, 'update-ref', ref, commit)
201
+ if seen:
202
+ stamps.set(str(path), seen)
108
203
  log(worktree=str(path), action='pushed' if pushed.returncode == 0 else 'failed', ref=ref)
109
204
 
110
205
 
206
+ def resume(paths, stamps):
207
+ """The worktrees in a stable order, starting after the last one a run
208
+ finished, so a run cut short by its budget never starves the others."""
209
+ last = stamps.get('cursor')
210
+ if last in paths:
211
+ at = paths.index(last) + 1
212
+ return paths[at:] + paths[:at]
213
+ return paths
214
+
215
+
216
+ def peak_mib():
217
+ # ru_maxrss is KiB on Linux; the git processes are the children.
218
+ return max(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
219
+ resource.getrusage(resource.RUSAGE_CHILDREN).ru_maxrss) // 1024
220
+
221
+
111
222
  def main():
112
223
  parser = argparse.ArgumentParser()
113
224
  parser.add_argument('--root', action='append', required=True)
114
225
  parser.add_argument('--node', default=socket.gethostname().split('.')[0])
115
226
  parser.add_argument('--remote', default='origin')
116
227
  parser.add_argument('--max-depth', type=int, default=3)
228
+ parser.add_argument('--budget', type=float, default=0,
229
+ help='seconds of work per run; 0 means no limit')
230
+ parser.add_argument('--state', default=None,
231
+ help='where fingerprints of saved work are kept')
117
232
  parser.add_argument('--dry-run', action='store_true')
118
233
  options = parser.parse_args()
119
- for root in options.root:
120
- for path in worktrees(Path(root).expanduser(), options.max_depth):
121
- try:
122
- guard(path, options.node, options.remote, options.dry_run)
123
- except (OSError, subprocess.SubprocessError):
124
- log(worktree=str(path), action='failed', reason='git')
234
+ started = time.monotonic()
235
+ stamps = Stamps(None if options.dry_run else options.state)
236
+ paths = [str(path) for root in options.root
237
+ for path in worktrees(Path(root).expanduser(), options.max_depth)]
238
+ visited = 0
239
+ for path in resume(paths, stamps):
240
+ # Every run makes progress: the first worktree is always taken.
241
+ if visited and options.budget and time.monotonic() - started > options.budget:
242
+ break
243
+ try:
244
+ guard(Path(path), options.node, options.remote, options.dry_run, stamps)
245
+ except (OSError, subprocess.SubprocessError):
246
+ log(worktree=path, action='failed', reason='git')
247
+ visited += 1
248
+ if not options.dry_run:
249
+ stamps.set('cursor', path)
250
+ log(event='run', worktrees=len(paths), visited=visited, deferred=len(paths) - visited,
251
+ seconds=round(time.monotonic() - started, 1), peak_mib=peak_mib())
125
252
 
126
253
 
127
254
  if __name__ == '__main__':
@@ -33,15 +33,11 @@ const COMMANDS: Record<string, string> = {
33
33
  'npm:@yarnpkg/cli-dist': 'yarn',
34
34
  'npm:vercel': 'vercel',
35
35
  'npm:wrangler': 'wrangler',
36
- 'aqua:anomalyco/opencode': 'opencode',
37
36
  'docker-cli': 'docker',
38
37
  opentofu: 'tofu',
39
38
  ripgrep: 'rg',
40
39
  rust: 'rustc',
41
40
  'npm:@devcontainers/cli': 'devcontainer',
42
- 'http:grok': 'grok',
43
- 'http:antigravity': 'antigravity',
44
- 'http:cursor-agent': 'cursor-agent',
45
41
  };
46
42
  const VERSION_ARGS: Record<string, string[]> = {
47
43
  tmux: ['-V'],
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # A T3 project script in a homelab checkout calls this. It warms the pinned
3
- # toolchain, then runs one homelab command. converge and converge-local take
3
+ # toolchain, then runs one homelab command. converge takes
4
4
  # this checkout's HEAD unless the caller already named a revision, asked to
5
5
  # roll back, or limited the run to accounts or the schedule.
6
6
  set -euo pipefail
@@ -9,7 +9,7 @@ cd "$root"
9
9
 
10
10
  if [[ $# -lt 1 ]]; then
11
11
  echo 'Usage: bootstrap/project-action.sh ACTION [args...]' >&2
12
- echo 'ACTION is a homelab command: converge, converge-local, check, tailnet, state, repair, workers, proxy, warm.' >&2
12
+ echo 'ACTION is a homelab command: converge, check, tailnet, state, repair, workers, proxy, warm.' >&2
13
13
  echo 'sync is converge. status is check --workers. infra-cliproxy is proxy.' >&2
14
14
  exit 2
15
15
  fi
@@ -20,7 +20,6 @@ shift
20
20
  command=()
21
21
  case "$action" in
22
22
  converge|sync) command=(converge) ;;
23
- converge-local) command=(converge-local) ;;
24
23
  check) command=(check) ;;
25
24
  status)
26
25
  command=(check)
@@ -39,7 +38,7 @@ case "$action" in
39
38
  proxy|infra-cliproxy) command=(proxy) ;;
40
39
  warm) ;;
41
40
  *)
42
- echo "Unknown project action '$action'. The homelab commands are converge, converge-local, check, tailnet, state, repair, workers, proxy and warm." >&2
41
+ echo "Unknown project action '$action'. The homelab commands are converge, check, tailnet, state, repair, workers, proxy and warm." >&2
43
42
  exit 2
44
43
  ;;
45
44
  esac
@@ -50,7 +49,7 @@ if [[ "$action" == warm ]]; then
50
49
  exit 0
51
50
  fi
52
51
 
53
- if [[ "${command[0]}" == converge || "${command[0]}" == converge-local ]]; then
52
+ if [[ "${command[0]}" == converge ]]; then
54
53
  pin=true
55
54
  for arg in "$@"; do
56
55
  case "$arg" in
@@ -44,21 +44,22 @@ function persistWindowsPath(bin: string, shims: string): void {
44
44
  );
45
45
  }
46
46
 
47
- /** Where a worker's agent commands are, when it has them: a link to
48
- * `agents/bin` of the applied revision, made by the worker's own converge
49
- * (src/agents/commands.ts). A machine without the link (the manager, a
50
- * development machine) has no such directory and its shells skip it.
51
- */
52
- export const agentCommands = (home = homedir()): string =>
53
- join(home, '.local', 'share', 'personal', 'fleet', 'agent-commands');
54
-
55
47
  export function configurePosixShellPath(
56
48
  bin: string,
57
49
  shims: string,
58
50
  home = homedir(),
59
51
  zdotdir = process.env['ZDOTDIR'] || home
60
52
  ): void {
61
- const agents = agentCommands(home);
53
+ // Earlier releases put a worker's agent launchers before the shims; what
54
+ // they wrote is removed wherever it stands.
55
+ const agents = join(
56
+ home,
57
+ '.local',
58
+ 'share',
59
+ 'personal',
60
+ 'fleet',
61
+ 'agent-commands'
62
+ );
62
63
  const quote = (value: string) => `'${value.replaceAll("'", "'\\''")}'`;
63
64
  const paths = quote(`${shims}:${bin}`);
64
65
  const legacy = `# homelab toolchain\nexport PATH=${paths}:"$PATH"`;
@@ -78,28 +79,25 @@ export function configurePosixShellPath(
78
79
  // apps that inherit its PATH (T3) run the locked tool versions.
79
80
  // Guarded like the block above so nested shells do not grow PATH.
80
81
  const unguarded = `${TAIL_MARKER}\nexport PATH=${quote(shims)}:"$PATH"\n`;
81
- // On a worker the agent commands come before the shims: `claude` is then
82
- // the fleet's launcher, through the CLI proxy, and the pinned CLI behind
83
- // it. Like the shims they are set twice: at the top, which a shell that is
84
- // not interactive reaches before a startup file returns early, and last.
85
82
  const agentsFirst = (marker: string) =>
86
83
  `${marker}\nif [ -d ${quote(agents)} ]; then\n case "$PATH" in\n ${quote(agents)}:*) ;;\n *) export PATH=${quote(agents)}:"$PATH" ;;\n esac\nfi\n`;
87
- const head = `${block}\n${agentsFirst(AGENTS_MARKER)}`;
84
+ const earlierHead = `${block}\n${agentsFirst(AGENTS_MARKER)}`;
88
85
  const shimsOnly = `${TAIL_MARKER}\ncase "$PATH" in\n ${quote(shims)}:*) ;;\n *) export PATH=${quote(shims)}:"$PATH" ;;\nesac\n`;
89
- // The shims count as first when only the agent commands precede them.
90
- const tail = `${TAIL_MARKER}\ncase "$PATH" in\n ${quote(shims)}:*|${quote(agents)}:${quote(shims)}:*) ;;\n *) export PATH=${quote(shims)}:"$PATH" ;;\nesac\n${agentsFirst(AGENTS_TAIL_MARKER)}`;
86
+ const earlierTail = `${TAIL_MARKER}\ncase "$PATH" in\n ${quote(shims)}:*|${quote(agents)}:${quote(shims)}:*) ;;\n *) export PATH=${quote(shims)}:"$PATH" ;;\nesac\n${agentsFirst(AGENTS_TAIL_MARKER)}`;
87
+ const head = block;
88
+ const tail = shimsOnly;
91
89
  for (const path of targets) {
92
90
  const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
93
91
  // What this and every earlier release wrote, wherever it stands.
94
92
  const body = [
95
- head,
93
+ earlierHead,
94
+ earlierTail,
96
95
  `${block}\n`,
97
96
  legacy,
98
- tail,
99
97
  shimsOnly,
100
98
  unguarded,
101
99
  ].reduce((text, earlier) => text.split(earlier).join(''), current);
102
- const next = `${head}${body.replace(/\n*$/, '\n')}${tail}`;
100
+ const next = `${head}\n${body.replace(/\n*$/, '\n')}${tail}`;
103
101
  if (next === current) continue;
104
102
  mkdirSync(dirname(path), { recursive: true });
105
103
  writeFileSync(path, next);
@@ -148,9 +148,9 @@ homelab proxy inference messages EXACT_CLAUDE_MODEL_ID
148
148
 
149
149
  `homelab accounts --add|--relogin|--remove` wraps these and propagates the result to every node; a login writes into a staging directory and only a complete credential is moved in. Codex uses the upstream device-code flow. Remote callback flows may require the documented dashboard callback flow or temporary SSH loopback forwarding; callback ports are not exposed by default. This pinned version has no generic Gemini CLI login flag; use its supported dashboard/API-key integration. Provider rules still govern permissible account use.
150
150
 
151
- **Account routing.** Credential files are the only list of accounts. `ops declared` (run by every converge) gives each Claude, Codex and Antigravity credential the model prefix `<type>-<email>` through the proxy's management API (`scripts/accounts.py`; a credential file is never edited directly). A request for `<type>-<email>/<model>` is served only by that account, and `/v1/models` lists those ids, which is how every fleet node discovers the accounts to offer in T3. Nothing in Git names an account.
151
+ **Account routing.** Credential files are the only list of accounts. `ops declared` (run by every converge) gives each Claude and Codex credential the model prefix `<type>-<email>` through the proxy's management API (`scripts/accounts.py`; a credential file is never edited directly). A request for `<type>-<email>/<model>` is served only by that account, and `/v1/models` lists those ids, which is how every fleet node discovers the accounts to offer in T3. Nothing in Git names an account.
152
152
 
153
- Unprefixed routing is **fill-first** (`routing.strategy: fill-first`): one account serves until its quota is exhausted and it cools down, then the next account, with session affinity keeping a session on its account while available and bounded retries across eligible accounts for the requested model. `cliproxy apply` requires this policy and the host monitor reports drift; see [Multi-account routing](docs/model-health.md#multi-account-routing-fill-first) for applying it to a running proxy. Automatic preview-model switching is disabled. The only model aliases are the ones `config.template.yaml` declares under `oauth.model-alias` (`ops` applies them and waits until `/v1/models` serves them); every other model id is the upstream id exactly as `/v1/models` lists it. [`models.json`](models.json) declares the model ids that are health-checked (`claude-opus-5-5`, `claude-sonnet-5-5`, `gpt-6-astra`, `gpt-6.1-sol`), and the checks fail loudly when one is not served. Usage statistics are enabled but are not a durable billing ledger. Available quota details depend on the provider.
153
+ Unprefixed routing is **fill-first** (`routing.strategy: fill-first`): one account serves until its quota is exhausted and it cools down, then the next account, with session affinity keeping a session on its account while available and bounded retries across eligible accounts for the requested model. `cliproxy apply` requires this policy and the host monitor reports drift; see [Multi-account routing](docs/model-health.md#multi-account-routing-fill-first) for applying it to a running proxy. Automatic preview-model switching is disabled. The fleet declares no model aliases: every other model id is the upstream id exactly as `/v1/models` lists it. [`models.json`](models.json) declares the model ids that are health-checked (`claude-opus-5-5`, `claude-sonnet-5-5`, `gpt-6-astra`, `gpt-6.1-sol`), and the checks fail loudly when one is not served. Usage statistics are enabled but are not a durable billing ledger. Available quota details depend on the provider.
154
154
 
155
155
  ## Fleet clients: macOS, Ubuntu and Windows/WSL
156
156
 
@@ -201,7 +201,7 @@ On the manager (or a replacement manager), prepare the tracked installation, log
201
201
 
202
202
  The `CLI proxy health` GitHub Actions workflow is the reusable workflow `.github/workflows/cliproxy-health.yml`. The repository that holds your `fleet.json` enables it with one `uses:` line: copy [`docs/health-workflow.example.yml`](docs/health-workflow.example.yml) into its `.github/workflows/` and name the homelab release tag your `package.json` pins. It needs no stored secret: the Vault address and the endpoint come from your `fleet.json`, and the checks from that exact release. The example runs it at minutes 7, 22, 37 and 52 of each hour and supports manual dispatch. It uses the existing read-only GitHub OIDC Vault role (`vault-role`, `github-actions` by default), with a short-lived token rather than a stored workstation/admin credential. From a GitHub-hosted runner it checks public endpoint authentication, available models, dashboard availability, a cloud checkpoint no more than 45 minutes old, and the last successful GC no more than nine days old. GC status is included in subsequent encrypted checkpoints. A failed workflow is visible independently of this workstation and uses GitHub's existing notification settings; it is not a guaranteed paging service, and schedules can be delayed by GitHub.
203
203
 
204
- The `CLI proxy health` workflow also runs the declarative model checks described in [Model validation and health checks](docs/model-health.md): a free readiness check every 15 minutes, a light two-request-per-model inference check hourly, a comprehensive nightly suite and an offline pull-request contract job, with per-model status, capability coverage, JSON/Markdown reports, an agent brief and a tracking issue. The local five-minute monitor does not run inference, attempt management logins, access provider credential files, prune storage, change cloud infrastructure, or restart the workstation. Management authorization remains covered by explicit verification; repeated failed management logins can trigger upstream IP bans, so they are excluded from scheduled monitoring. Its Restic client permits only read operations and uses no remote locks, so a killed runner cannot leave a lock blocking backups. Concurrent pruning can cause a transient read failure; subsequent scheduled runs retry. HTTPS redirects are rejected to prevent forwarding credentials to another origin.
204
+ The `CLI proxy health` workflow also runs the declarative model checks described in [Model validation and health checks](docs/model-health.md): a free readiness check every 15 minutes, a light two-request-per-model inference check daily, a comprehensive weekly suite and an offline pull-request contract job, with per-model status, capability coverage, JSON/Markdown reports, an agent brief and a tracking issue. The local five-minute monitor does not run inference, attempt management logins, access provider credential files, prune storage, change cloud infrastructure, or restart the workstation. Management authorization remains covered by explicit verification; repeated failed management logins can trigger upstream IP bans, so they are excluded from scheduled monitoring. Its Restic client permits only read operations and uses no remote locks, so a killed runner cannot leave a lock blocking backups. Concurrent pruning can cause a transient read failure; subsequent scheduled runs retry. HTTPS redirects are rejected to prevent forwarding credentials to another origin.
205
205
 
206
206
  With an existing private Vault token, one command prepares a complete offline replacement cache:
207
207
 
@@ -247,9 +247,8 @@ proxy owner is `manager.id`. Flags: `--definition`, `--node`, `--revision`,
247
247
  `image.lock.json` changed; then it is recreated, which briefly interrupts
248
248
  in-flight inference. `PROXY_UPDATE_PENDING` remains only when that install
249
249
  failed. Settings the fleet owns in the live
250
- config (`oauth.model-alias` and `upstream.claude`, from `config.template.yaml`;
251
- the Claude Code version the proxy presents to Anthropic is replaced with the
252
- `claude` pin in `mise.toml`, so it follows the harness every node runs) are compared
250
+ config (`upstream.claude`, from `config.template.yaml`, which carries the
251
+ Claude Code version the proxy presents to Anthropic) are compared
253
252
  by `ops declared` (exit 3 when they differ) and reported as
254
253
  `PROXY_CONFIG_PENDING`; `ops declared --apply` (run by every converge)
255
254
  validates and stages the candidate, replaces only those keys and relies on
@@ -17,19 +17,6 @@ access:
17
17
  - REPLACE_CLIENT_KEY
18
18
  oauth:
19
19
  auth-dir: /state/auths
20
- # Fleet-owned (applied by `ops declared`): the Antigravity CLI sends its
21
- # catalog ids; serve them from the Antigravity account's matching models.
22
- model-alias:
23
- antigravity:
24
- - name: gemini-4-neon-xhigh
25
- alias: gemini-4-neon
26
- fork: true
27
- - name: gemini-3.8-flash-high
28
- alias: gemini-3.8-flash
29
- fork: true
30
- - name: gemini-3.1-flash-lite
31
- alias: gemini-3.1-flash-lite-preview
32
- fork: true
33
20
  routing:
34
21
  # Fill first: use one account until its quota is exhausted (it then cools down), then the next.
35
22
  # Sessions stay bound to their account while it is available; new sessions start on the first
@@ -48,8 +35,7 @@ upstream:
48
35
  claude:
49
36
  # Fleet-owned (applied by `ops declared`): the proxy presents itself to
50
37
  # Anthropic as this Claude Code version, and Anthropic refuses newer models
51
- # to an older one. converge replaces the version with the `claude` pin in
52
- # mise.toml on every run, so it follows the harness every node runs.
38
+ # to an older one. Raise it here, in review, when Anthropic requires it.
53
39
  header-defaults:
54
40
  user-agent: 'claude-cli/2.1.314 (external, cli)'
55
41
  # T3 runs Claude Code under its own entrypoint label.