t3-auto-build 1.0.1 → 2.0.1

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/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # t3-auto-build
2
2
 
3
- <p align="center"><img src="https://raw.githubusercontent.com/mirceas94/t3-auto-build/main/assets/banner.svg" alt="t3-auto-build: multi-model builds in parallel waves with safety guards, fed by Codex, Antigravity and Claude" width="100%"></p>
3
+ <p align="center"><img src="https://raw.githubusercontent.com/mirceas94/t3-auto-build/main/assets/banner.svg" alt="t3-auto-build: subscription-aware multi-model routing with safety guards across Codex, Antigravity and Claude" width="100%"></p>
4
4
 
5
5
  <p align="center">Cross-platform installer and <code>$auto-build</code> orchestration suite for T3 Code.</p>
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/t3-auto-build"><img src="https://img.shields.io/npm/v/t3-auto-build" alt="npm version"></a>
9
9
  <a href="https://github.com/mirceas94/t3-auto-build/actions/workflows/ci.yml"><img src="https://github.com/mirceas94/t3-auto-build/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI status on main"></a>
10
- <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node 18 or newer">
10
+ <img src="https://img.shields.io/badge/node-%3E%3D18.18-brightgreen" alt="Node 18.18 or newer">
11
11
  <img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero dependencies">
12
12
  <img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license">
13
13
  </p>
@@ -16,40 +16,212 @@
16
16
 
17
17
  Cross-platform installer and `$auto-build` orchestration suite for T3 Code: a coding-discipline
18
18
  `CLAUDE.md`, slash commands, an `auto-build` skill rendered from your own model config, and Node
19
- hooks for guardrails. No dependencies. Node 18 or newer.
19
+ hooks for guardrails. No dependencies. Node 18.18 or newer.
20
20
 
21
- - **Multi-model routing:** presets for Codex, Antigravity and Claude, with failover along model ladders.
21
+ - **Subscription profiles:** tell `init` your Claude, Codex and Antigravity plans; models, ladders and parallelism follow.
22
22
  - **Parallel waves:** larger tasks are split into file-disjoint waves with checks between them.
23
- - **Guardrails:** hooks block secret-file edits, some destructive commands and disallowed delegate models.
24
- - **Quota aware:** cooldown locks keep delegation away from exhausted providers and models.
23
+ - **Guardrails:** hooks block secret-file edits, some destructive commands and disallowed delegate calls.
24
+ - **Quota aware:** cooldown locks and an availability cache keep delegation away from exhausted or restricted models.
25
25
  - **Careful installs:** your edited files are kept unless you pass `--force`, which backs them up first.
26
- - **Zero dependencies:** plain Node, 18 or newer.
26
+ - **Zero dependencies:** plain Node, 18.18 or newer.
27
+
28
+ Upgrading from 1.x? Read [Migrating from v1](#migrating-from-v1) and the [changelog](CHANGELOG.md).
27
29
 
28
30
  ## 60-second Quick Start
29
31
 
30
- 1. Install into your Claude config directory:
32
+ 1. Install into your Claude config directory, naming your plans (see the [tier matrix](#subscription-tiers)):
31
33
 
32
34
  ```sh
33
- npx t3-auto-build init
35
+ npx t3-auto-build init --claude-tier max --codex-tier plus --antigravity-tier pro --yes
34
36
  ```
35
37
 
36
- From a clone, `node bin/cli.mjs init` does the same.
38
+ Plain `npx t3-auto-build init` asks instead. From a clone, use `node bin/cli.mjs` in place of
39
+ `npx t3-auto-build`. `init` prints what it resolved:
40
+
41
+ ```text
42
+ provider | tier | CLI | models (standard) | scarce overflow | max parallel
43
+ claude | max | yes | claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5 | - | 2
44
+ codex | plus | yes | gpt-6-luna, gpt-6.1-terra | - | 1
45
+ antigravity | pro | yes | gemini-4-hydrogen, gemini-4-neon, gemini-4-carbon | claude-sonnet-5-5, claude-opus-5-5 | 2
46
+ parent: opus (medium)
47
+ max parallel builders: 5
48
+ ```
37
49
 
38
- 2. Check the result:
50
+ > `init --yes` **without** a tier flag on a fresh directory writes a legacy v1
51
+ > [preset](#legacy-presets) config, not a subscription profile.
52
+
53
+ 2. Check the installation and fill the availability cache:
39
54
 
40
55
  ```sh
41
56
  npx t3-auto-build doctor
57
+ npx t3-auto-build check-models
42
58
  ```
43
59
 
44
- From a clone: `node bin/cli.mjs doctor`.
60
+ `check-models` sends real prompts when its cache is stale. See [availability](#availability-checks).
45
61
 
46
62
  3. **Restart T3 Code** (and any running Claude Code session). Hooks and `settings.json` changes
47
63
  load only at startup.
48
64
 
49
65
  4. In a T3 Code thread, run `$auto-build <task>`. See [workflow](#auto-build-workflow) for flags.
50
66
 
51
- The skill calls `t3-auto-build quota ...`. From a clone, `npm link` puts that command on `PATH`.
52
- Without it the skill reads or edits the cooldown file directly.
67
+ The skill calls `t3-auto-build ...`. From a clone, `npm link` puts that command on `PATH`.
68
+ Without it the skill reads the cooldown and availability files directly.
69
+
70
+ ## Subscription tiers
71
+
72
+ Pass `--claude-tier`, `--codex-tier` and `--antigravity-tier`. An omitted provider is `none` on a
73
+ fresh install, keeps its tier on a v2 config, and gets the [assumed tier](#migrating-from-v1) on a
74
+ v1 config. At least one provider needs a CLI-capable tier.
75
+
76
+ | Provider | Tier | CLI | Standard models | Scarce overflow | Max parallel | Warning |
77
+ |---|---|---|---|---|---|---|
78
+ | claude | `none` | no | – | – | 0 | no Claude subscription selected |
79
+ | claude | `free` | no | – | – | 0 | Claude Code requires Pro or higher (or api) |
80
+ | claude | `pro` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | – | 1 | – |
81
+ | claude | `max` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | – | 2 | – |
82
+ | claude | `ultra` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | `claude-fable-5-2` | 3 | – |
83
+ | claude | `team-standard` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | – | 1 | – |
84
+ | claude | `team-premium` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | – | 2 | – |
85
+ | claude | `api` | yes | `claude-haiku-5-5`, `claude-sonnet-5-5`, `claude-opus-5-5` | `claude-fable-5-2` | 3 | API usage is billed per token |
86
+ | codex | `none` | no | – | – | 0 | no Codex subscription selected |
87
+ | codex | `free` | yes | `gpt-6-luna`, `gpt-5.6-terra`, `gpt-5.6-luna` | – | 1 | – |
88
+ | codex | `go` | yes | `gpt-6-luna`, `gpt-5.6-terra`, `gpt-5.6-luna` | – | 1 | – |
89
+ | codex | `plus` | yes | `gpt-6-luna`, `gpt-6.1-terra` | – | 1 | – |
90
+ | codex | `pro-100` | yes | `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.1-sol` | `gpt-6-astra` | 2 | – |
91
+ | codex | `pro-200` | yes | `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.1-sol` | `gpt-6-astra` | 2 | – |
92
+ | codex | `pro-500` | yes | `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.1-sol` | `gpt-6-astra` | 3 | – |
93
+ | codex | `business` | yes | `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.1-sol` | `gpt-6-astra` | 2 | – |
94
+ | codex | `api` | yes | `gpt-6-luna`, `gpt-6.1-terra`, `gpt-6.1-sol` | `gpt-6-astra` | 3 | API usage is billed per token |
95
+ | antigravity | `none` | no | – | – | 0 | no Antigravity subscription selected |
96
+ | antigravity | `free` | yes | `gemini-4-hydrogen`, `gemini-4-neon` | – | 1 | – |
97
+ | antigravity | `plus` | yes | `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon` | – | 1 | – |
98
+ | antigravity | `pro-trial` | yes | `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon` | – | 1 | – |
99
+ | antigravity | `pro` | yes | `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon` | `claude-sonnet-5-5`, `claude-opus-5-5` | 2 | – |
100
+ | antigravity | `ultra-5x` | yes | `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon` | `claude-sonnet-5-5`, `claude-opus-5-5` | 2 | – |
101
+ | antigravity | `ultra-20x` | yes | `gemini-4-hydrogen`, `gemini-4-neon`, `gemini-4-carbon` | `claude-sonnet-5-5`, `claude-opus-5-5` | 3 | – |
102
+
103
+ - Resolved parallelism is the sum over eligible providers, capped at 6. Builder counts and quota
104
+ windows are estimates.
105
+ - `api` tiers are billed per token. Their models are excluded (and listed as plan-restricted)
106
+ unless you pass `--allow-usage-credits`.
107
+ - Ladders use native standard models first, interleaving providers. Scarce models come last, as
108
+ overflow or escalation.
109
+
110
+ ### Parent model
111
+
112
+ The parent is the model of the orchestrating Claude session. It needs an eligible Claude tier.
113
+
114
+ | Claude tier | Default parent / effort | `--parent` options |
115
+ |---|---|---|
116
+ | `pro`, `team-standard` | `sonnet` / `medium` | `sonnet`, `opus` |
117
+ | `max`, `team-premium` | `opus` / `medium` | `sonnet`, `opus` |
118
+ | `ultra`, `api` | `opus` / `medium` | `sonnet`, `opus`, `fable` |
119
+
120
+ An `api` tier counts only with `--allow-usage-credits`.
121
+
122
+ `--parent fable` selects `claude-fable-5-2`, from the scarce `fable` pool. `init` writes `model` and
123
+ `effortLevel` to `settings.json` only when the key is absent or still holds the value it wrote
124
+ before. Without an eligible Claude tier, no parent is set.
125
+
126
+ ### Cross-hosted overflow
127
+
128
+ Antigravity `pro`, `ultra-5x` and `ultra-20x` also host `claude-sonnet-5-5` and `claude-opus-5-5`,
129
+ in the scarce pool `third-party-claude`.
130
+
131
+ - Reach them only with an explicit `provider: "antigravity"` (ladders write
132
+ `antigravity:claude-opus-5-5@medium`).
133
+ - A bare `claude-*` model always resolves to native Claude, never to Antigravity.
134
+ - A model the named provider does not host, or two different providers in one call, is blocked.
135
+
136
+ ## Availability checks
137
+
138
+ The skill runs `t3-auto-build check-models` at the start of every run. Results go to
139
+ `<config dir>/auto-build-availability.json`.
140
+
141
+ | Check | When | Cost |
142
+ |---|---|---|
143
+ | 1. Discovery: binary and `--version` check, plus your listing adapters | every `check-models` | no model calls |
144
+ | 2. Probes of standard-pool models | cache older than 12 h since the last probe, or `--refresh` | one short prompt per model |
145
+ | Scarce-pool probes | never, unless `--probe-scarce` is set and check 2 runs | real scarce quota |
146
+ | 3. Reactive marks: `availability mark` after a plan error | on demand | none |
147
+
148
+ > Probe processes inherit your environment. If an API key variable (such as `ANTHROPIC_API_KEY` or
149
+ > `OPENAI_API_KEY`) is set, the CLI may use it and the probes may be billed to the API.
150
+
151
+ - Probe results never block a model unless they say `plan-restricted`. A failed or timed-out probe
152
+ blocks nothing. A manual mark of `plan-restricted` or `unavailable` blocks.
153
+ - A live manual mark beats discovery and probe results. Its `--ttl` is one number plus `m`, `h` or
154
+ `d`, above zero and at most `30d` (default `24h`).
155
+ - Antigravity has no probe support.
156
+ - After its summary line, `check-models` prints one `provider:model status` line per configured model:
157
+ `available` (nothing speaks against it), `rate-limited` (locked or limited), `plan-restricted`,
158
+ `unavailable` or `skipped-scarce`.
159
+
160
+ ### Lock rechecks
161
+
162
+ A lock lasting more than 6 hours gets `setAt` and `recheckAfter` (6 hours later). Once a provider lock
163
+ is past `recheckAfter`, or for every provider lock with `--recheck-locks`, `check-models` tests the
164
+ cheapest configured standard model:
165
+
166
+ - With a Claude or Codex CLI installed, it sends one probe. Success clears the lock; any other result
167
+ moves `recheckAfter` 6 hours ahead.
168
+ - Otherwise (such as Antigravity) it prints `recheck-via-t3: <provider> (<model>)`. The skill then
169
+ clears the lock, sends a one-word canary `delegate_task`, and re-locks only on a rate limit.
170
+
171
+ Model and pool locks are not rechecked.
172
+
173
+ ```sh
174
+ t3-auto-build availability mark antigravity:claude-opus-5-5 plan-restricted --ttl 24h --reason "not in plan"
175
+ t3-auto-build availability status
176
+ ```
177
+
178
+ ### Model drift
179
+
180
+ No provider CLI listing is built in. To detect new or missing models, add an adapter per provider to
181
+ the config: an argv array whose stdout is a JSON array or a newline list of model ids.
182
+
183
+ ```json
184
+ { "discovery": { "codex": ["node", "<absolute path>/list-codex-models.mjs"] } }
185
+ ```
186
+
187
+ `list-codex-models.mjs` is a placeholder for your own script. Adapters run in an empty temp
188
+ directory, so use absolute paths. `check-models` then reports ids that
189
+ are not configured, and configured native models the adapter did not list. Nothing is allowed
190
+ automatically. To adopt newer versions:
191
+
192
+ ```sh
193
+ t3-auto-build check-models
194
+ t3-auto-build sync-models --apply
195
+ ```
196
+
197
+ `--apply` runs no probes. It reads the availability cache and replaces a configured model with a
198
+ newer version of the same family, keeping its pool and ladder position. Retired, banned and
199
+ plan-restricted ids are never promoted; unknown families are reported and stay disabled. It backs up
200
+ the config and re-renders `SKILL.md`. It needs an `auto-build` or `full` install.
201
+
202
+ ## Model bans
203
+
204
+ Three layers apply to `delegate_task` calls.
205
+
206
+ | Layer | Source | Can you remove it? |
207
+ |---|---|---|
208
+ | Retired | built in, plus `retiredModels` | Not the built-in entries. Config can only add. |
209
+ | Plan-restricted | `planRestrictedModels` (`provider:model` or bare model) and live availability entries | Change tiers, or let the mark expire or replace it |
210
+ | User-banned | `userBannedModels` / `bannedModels` | Yes, edit both lists in the config |
211
+
212
+ Built-in retired patterns: `gemini-4-argon`, `gemini-3.8-flash`, `claude-4.6`, `claude-4.6-*`,
213
+ `gpt-5.4`, `gpt-5.4-*`, `gpt-5.5`, `gpt-5.5-*`. Matching treats `.` and `-` alike, accepts display
214
+ names (`GPT 5.4 Mini`) and ignores a trailing date. A `-*` pattern covers the stem and its suffixed
215
+ variants; `gpt-5.40` does not match `gpt-5.4`.
216
+
217
+ User bans match as case-insensitive substrings, and `A/B` bans both. A short entry such as `Claude`
218
+ bans every model whose name contains it.
219
+
220
+ ## Speed-mode guard
221
+
222
+ Unless the config has `"allowFastModes": true`, a `delegate_task` call is blocked when a key matching
223
+ `fast`, `speed` or `serviceTier` is `true`, `fast`, `ultrafast` or `priority`. Set it with
224
+ `init --allow-fast-modes`.
53
225
 
54
226
  ## auto-build workflow
55
227
 
@@ -71,12 +243,14 @@ flowchart TD
71
243
  verify -->|"passed"| report["Optional commit and report"]
72
244
  ```
73
245
 
74
- 1. **Step 0:** check lockouts, record the `git status` baseline, resume if asked.
246
+ 1. **Step 0:** run `t3-auto-build check-models`, check lockouts and restrictions, record the
247
+ `git status` baseline, resume if asked.
75
248
  2. **Triage:** write a short `REPO_BRIEF` (using the cached `.claude/repo-profile.md`) and pick the
76
249
  level `L0` to `L3` and work shape `A` (multi-file, UI) or `B` (algorithms, debugging).
77
250
  3. **Plan** (`L2`/`L3`), cross-checked by another provider on `L3` when available.
78
251
  4. **Build:** `L2`/`L3` run in file-disjoint waves: foundations, core, tests/docs. Builders in a wave
79
- run in parallel; the diff guard and exit checks pass before the next wave.
252
+ run in parallel, at most `maxParallelBuilders` at once; the diff guard and exit checks pass before
253
+ the next wave.
80
254
  5. **Verify:** blind edge-case tests (`L2`/`L3`), tests and lint, a diff-only audit preferring
81
255
  another provider (two auditors on `L3`), at most 2 fix rounds, then an optional commit and a
82
256
  report.
@@ -102,33 +276,74 @@ resume later.
102
276
 
103
277
  ## CLI
104
278
 
279
+ ```text
280
+ t3-auto-build init
281
+ t3-auto-build upgrade [--yes]
282
+ t3-auto-build check-models [--refresh] [--probe-scarce] [--recheck-locks] [--json]
283
+ t3-auto-build sync-models [--auto] [--refresh] [--probe-scarce] [--apply]
284
+ t3-auto-build availability mark <provider:model> <available|plan-restricted|unavailable> [--ttl 24h] [--reason <text>]
285
+ t3-auto-build availability status
286
+ t3-auto-build quota set <subject>
287
+ t3-auto-build quota status
288
+ t3-auto-build quota clear [subject]
289
+ t3-auto-build quota check [provider]
290
+ t3-auto-build doctor
291
+ t3-auto-build uninstall
292
+ ```
293
+
105
294
  | Command | What it does |
106
295
  |---|---|
107
- | `t3-auto-build init` | Installs or updates. Interactive unless `--yes`. |
108
- | `t3-auto-build doctor` | Checks files, JSON and hook wiring, runs each hook with mock input, looks for `rg` and `sg`. |
109
- | `t3-auto-build uninstall` | Removes what `init` installed and keeps files you changed. |
110
- | `t3-auto-build sync-models` | Probes models with the provider CLIs and updates the allowlist. |
111
- | `t3-auto-build quota set\|status\|clear\|check` | Manages cooldown locks. |
296
+ | `init` | Installs or updates. Interactive unless `--yes`. |
297
+ | `upgrade` | Converts a v1 config to v2. Never prompts. |
298
+ | `check-models` | Prunes expired state, runs discovery, probes if the cache is stale. |
299
+ | `sync-models` | Probes models and updates the allowlist, or applies drift with `--apply`. |
300
+ | `availability mark\|status` | Sets or shows model availability. |
301
+ | `quota set\|status\|clear\|check` | Manages cooldown locks. |
302
+ | `doctor` | Checks files, config, hook wiring, cache age, tiers against CLI binaries, drift and optional tools. |
303
+ | `uninstall` | Removes what `init` installed and the availability cache. Keeps files you changed and the cooldown file. |
112
304
 
113
305
  | Option | Applies to | Meaning |
114
306
  |---|---|---|
115
307
  | `--target <dir>` | all | Config directory. Default: `$CLAUDE_CONFIG_DIR`, else `~/.claude`. |
116
- | `--preset <name>` | init | `tri-provider`, `claude-codex` or `claude-only`. |
308
+ | `-h`, `--help` | all | Show the usage text. |
309
+ | `-v`, `--version` | no command | Print the version. |
310
+ | `--yes` | init, upgrade, sync-models | No prompts. Without an interactive terminal, `init` requires it, and `sync-models` requires it, `--auto` or `--dry-run`. |
311
+ | `--preset <name>` | init | `tri-provider`, `claude-codex` or `claude-only`. Legacy configs only. |
117
312
  | `--modules <name>` | init | `full`, `auto-build` or `core`. |
118
313
  | `--compaction <n>` | init | Integer from 1 to 100. |
119
- | `--tiers <list>` | init | `provider:plan[:weekday]`, comma separated. |
314
+ | `--tiers <list>` | init | Legacy `provider:plan[:weekday]` list. Ignored for v2 configs. |
315
+ | `--claude-tier <tier>` | init | `none`, `free`, `pro`, `max`, `ultra`, `team-standard`, `team-premium`, `api`. |
316
+ | `--codex-tier <tier>` | init | `none`, `free`, `go`, `plus`, `pro-100`, `pro-200`, `pro-500`, `business`, `api`. |
317
+ | `--antigravity-tier <tier>` | init | `none`, `free`, `plus`, `pro-trial`, `pro`, `ultra-5x`, `ultra-20x`. |
318
+ | `--parent <model>` | init | `sonnet`, `opus` or `fable`. See [parent model](#parent-model). |
319
+ | `--allow-usage-credits` | init | Include per-token `api` tiers. Needs a tier or a v2 config. |
320
+ | `--allow-fast-modes` | init | Permit fast or priority service modes. Needs a tier or a v2 config. |
321
+ | `--verified-org` | init | Record `verifiedOrg: true` in a v2 config. No routing or hook reads it. |
120
322
  | `--probe` | init | Run `sync-models` after installing. Spends real quota. Ignored for `core`. |
121
- | `--yes` | init, sync-models | No prompts. Without an interactive terminal, `init` requires it and `sync-models` requires it or `--dry-run`. |
122
323
  | `--force` | init, sync-models | Back up your changed files to `<file>.bak`, then overwrite. For `sync-models`, this covers a hand-edited `SKILL.md`. |
324
+ | `--refresh` | check-models, sync-models | Ignore the probe cache TTL. `sync-models` without `--apply` always probes. |
325
+ | `--probe-scarce` | check-models, sync-models | Also probe scarce-pool models. |
326
+ | `--recheck-locks` | check-models | Recheck every active provider lock now. |
327
+ | `--json` | check-models | Machine-readable result. |
328
+ | `--auto` | sync-models | Write without confirmation, like `--yes`. |
329
+ | `--apply` | sync-models | Promote newer versions from recorded drift. |
123
330
  | `--dry-run` | sync-models | Probe and print the result; write nothing. **Still spends real quota.** |
124
331
  | `--providers <list>` | sync-models | Only these of `claude`, `codex`, `antigravity`; comma separated. |
125
- | `--burst`, `--5h`, `--weekly`, `--until <when>`, `--reason <text>` | quota set | See [Quota](#quota). |
332
+ | `--ttl <duration>` | availability mark | `1m` to `30d`, default `24h`. |
333
+ | `--pool <name>` | quota set | Lock a pool: `standard`, `fable`, `astra`, `third-party-claude`, or another lowercase name. |
334
+ | `--burst`, `--5h`, `--weekly`, `--until <when>` | quota set | Lock window; one only. Default `--burst`. |
335
+ | `--reason <text>` | quota set, availability mark | Note shown by the status command. |
126
336
  | `--all` | quota clear | Remove every lock. |
127
- | `--version`, `-v` | no command | Print the version. |
128
- | `-h`, `--help` | all | Show the usage text. |
129
337
 
130
338
  Exit codes: `0` success, `1` failure (invalid JSON, broken install), `2` usage error.
131
339
 
340
+ ```sh
341
+ t3-auto-build init --claude-tier pro --codex-tier plus --antigravity-tier pro --parent opus
342
+ t3-auto-build check-models --json
343
+ t3-auto-build sync-models --refresh --probe-scarce
344
+ t3-auto-build quota set antigravity:claude-opus-5-5 --pool third-party-claude
345
+ ```
346
+
132
347
  ### Modules
133
348
 
134
349
  | `--modules` | Name | CLAUDE.md, rules, commands | Skill, config, hooks, `settings.json` |
@@ -139,17 +354,12 @@ Exit codes: `0` success, `1` failure (invalid JSON, broken install), `2` usage e
139
354
 
140
355
  A re-run without `--modules` keeps the previous choice. When you change it, `init` removes the files
141
356
  that no longer belong and keeps and reports the ones you changed. Switching to `core` also removes
142
- the hook entries and environment value from `settings.json`. That cleanup is the one case where a
357
+ the hook entries and the values `init` set in `settings.json`. That cleanup is the one case where a
143
358
  `core` run writes `settings.json`.
144
359
 
145
- ## Presets and safety guards
360
+ ## Legacy presets
146
361
 
147
- A preset sets the model allowlist, ladders and defaults. The installed hooks block secret-file edits,
148
- force pushes and hard resets, protected recursive `rm` targets, and `delegate_task` calls to banned,
149
- non-allowlisted or locked models. They are a safety net, not a sandbox: see [Hooks](#hooks) and its
150
- [known limits](#known-limits).
151
-
152
- ### Preset matrix
362
+ Without subscription tiers, `init` writes a v1 config from a preset.
153
363
 
154
364
  | Preset | Models | Codex | Antigravity | Claude | Dual audit |
155
365
  |---|---|---|---|---|---|
@@ -157,44 +367,78 @@ non-allowlisted or locked models. They are a safety net, not a sandbox: see [Hoo
157
367
  | `claude-codex` | 6 | 3 | 0 | 3 | Claude Opus 5.5 + gpt-6-luna |
158
368
  | `claude-only` | 3 | 0 | 0 | 3 | Claude Opus 5.5 + Claude Sonnet 5.5 |
159
369
 
160
- Every preset bans `Argon` and `Fable/Mythos`, defaults to Claude Sonnet 5.5 at `medium` effort and
161
- sets the auto-compaction threshold to 35%.
162
-
163
- ### Provider detection and tiers
370
+ Every preset defaults to Claude Sonnet 5.5 at `medium` effort and sets the auto-compaction threshold
371
+ to 35%. Presets ban no models of their own; the [retired list](#model-bans) always applies.
164
372
 
165
- Interactive `init` on a fresh target picks the default preset from the binaries on `PATH`: `claude`,
166
- `codex` and `antigravity` give `tri-provider`, `claude` and `codex` give `claude-codex`, anything
167
- else gives `claude-only`. Provider config folders are only checked for existence and do not change
168
- the preset. With an existing config its preset is the default. `init --yes` does not detect: a fresh
169
- install without `--preset` uses `tri-provider`.
373
+ Interactive `init` on a fresh target suggests tiers (Claude `pro`, Codex `plus`, Antigravity `plus`)
374
+ for the `claude`, `codex` and `antigravity` binaries on `PATH`. If you choose `none` everywhere, it
375
+ asks for a preset. Provider config folders are only checked for existence. `init --yes` does not
376
+ detect: a fresh install without `--preset` or a tier uses `tri-provider`.
170
377
 
171
- `--tiers provider:plan[:weekday]`, comma separated (for example `claude:max:monday,codex:plus`),
172
- records subscription plans. Interactive `init` asks for each detected provider when the flag is
173
- absent.
378
+ `--tiers provider:plan[:weekday]` (for example `claude:max:monday,codex:plus`) records how limits are
379
+ shared in a v1 config.
174
380
 
175
- | Provider | Plan: short-window limit locks the provider | Plan: locks only the heavy model | Heavy model |
381
+ | Provider | Plan: short-window limit locks the provider | Plan: locks only the scarce pool | Pool |
176
382
  |---|---|---|---|
177
- | `claude` | `pro` | `max` | Claude Opus 5.5 |
178
- | `codex` | `plus` | `pro` | gpt-6-luna |
179
- | `antigravity` | `standard` | `ultra` | Gemini 4 Carbon |
383
+ | `claude` | `pro` | `max` | `fable` |
384
+ | `codex` | `plus` | `pro` | `astra` |
385
+ | `antigravity` | `standard` | `ultra` | `third-party-claude` |
386
+
387
+ The weekday (`monday` or `mon`) is the weekly reset day, taken as 00:00 UTC.
388
+
389
+ ## Migrating from v1
390
+
391
+ v1 configs keep loading, with the retired list enforced. To convert:
392
+
393
+ 1. Run the v2 package:
180
394
 
181
- The weekday (`monday` or `mon`) is the weekly reset day, taken as 00:00 UTC. A custom `heavyModels`
182
- list in the config is kept.
395
+ ```sh
396
+ npx t3-auto-build@latest upgrade
397
+ ```
398
+
399
+ 2. `upgrade` assumes low paid tiers, because a v1 config does not say what you pay for: Claude `pro`,
400
+ Codex `plus`, Antigravity `plus` for each provider in your allowlist, else `none`.
401
+ 3. Set your real tiers:
402
+
403
+ ```sh
404
+ npx t3-auto-build init --claude-tier max --codex-tier pro-200 --antigravity-tier pro
405
+ ```
406
+
407
+ Until then no scarce or cross-hosted model is configured.
408
+ 4. Restart T3 Code.
409
+
410
+ What `upgrade` does:
411
+
412
+ - Backs up `auto-build.config.json` to `.bak` (`.bak.1` and so on if a different backup exists).
413
+ - Moves your `bannedModels` to `userBannedModels`, dropping the old defaults `Argon` and
414
+ `Fable/Mythos`. `bannedModels` mirrors the list.
415
+ - Keeps `compactionThreshold`, `defaultEffort`, `modelIds` and `discovery`. Ladder entries still in
416
+ the new roster stay in place; others are replaced.
417
+ - Rebuilds the rest from the tiers. Custom allowlist entries, `defaultModel`, `planRestricted` and
418
+ `tiers` are not carried over.
419
+ - Re-renders the managed files you have not edited and updates `settings.json`, including `model` and
420
+ `effortLevel` when absent.
421
+ - Does nothing on a config that is already v2.
422
+
423
+ Existing `tier:<provider>:heavy` cooldown keys are still read.
183
424
 
184
425
  ## sync-models
185
426
 
186
427
  > **`sync-models --dry-run` still executes live probes.** It spends real quota and writes nothing.
428
+ > The [API billing warning](#availability-checks) applies.
187
429
 
188
- > Probe processes inherit your environment. If an API key variable (such as `ANTHROPIC_API_KEY` or
189
- > `OPENAI_API_KEY`) is set, the CLI may use it and the probes may be billed to the API.
190
-
191
- Candidates are the config allowlist, its `planRestricted` models and the preset's models; banned
192
- models are skipped. Each gets a one-word prompt through `claude -p` or `codex exec`, in an empty temp
193
- directory with a 20 s timeout. `claude` runs with tools disabled, safe mode and no session
430
+ Candidates are the config allowlist, its `planRestricted` models and the preset's models (a `custom`
431
+ config uses the `tri-provider` preset). Banned models and, without `--probe-scarce`, scarce models
432
+ are not probed. Each other model gets a one-word prompt through `claude -p` or `codex exec`, in an
433
+ empty temp directory with a 20 s timeout. `claude` runs with tools disabled, safe mode and no session
194
434
  persistence. `codex` runs read-only and ephemeral with `--ignore-user-config` and `--ignore-rules`,
195
435
  so your Codex user config does not apply. Antigravity has no probe support: its models report
196
436
  `unavailable` and keep their current membership.
197
437
 
438
+ > On a v2 config, preset models count as candidates too. A successful probe can therefore add
439
+ > allowlist entries beyond your tier, including display-name duplicates. Review the changes before you
440
+ > confirm, or use `check-models` with `sync-models --apply`.
441
+
198
442
  | State | Effect on the config |
199
443
  |---|---|
200
444
  | `available` | Added to or kept in `allowlist`; removed from `planRestricted`. |
@@ -212,68 +456,91 @@ Writing needs an `auto-build` or `full` install; `--dry-run` needs only the conf
212
456
  ## Quota
213
457
 
214
458
  ```sh
215
- t3-auto-build quota set <claude|codex|antigravity|model> [--burst|--5h|--weekly|--until <when>] [--reason <text>]
459
+ t3-auto-build quota set <provider|model|provider:model> [--pool <name>] [--burst|--5h|--weekly|--until <when>] [--reason <text>]
216
460
  t3-auto-build quota status
217
- t3-auto-build quota clear <provider|model> # or --all
461
+ t3-auto-build quota clear <provider|model|provider:model> # or --all
218
462
  t3-auto-build quota check [provider]
219
463
  ```
220
464
 
221
- - `set` locks one provider or model. The default `--burst` is 10 minutes; `--5h` is 5 hours;
222
- `--weekly` runs to the tier's reset day, else 7 days. `--until` takes a future ISO time or a
223
- duration such as `90m` or `1w2d`. `--5h` on a provider whose tier locks only the heavy model writes
224
- `tier:<p>:heavy`.
465
+ - `set claude` locks the provider; `set claude-opus-5-5` locks that model on every hosting;
466
+ `set antigravity:claude-opus-5-5` locks that hosting only. With `--pool`, any of these locks that
467
+ pool of the provider instead (a bare model means its native provider).
468
+ - The default `--burst` is 10 minutes; `--5h` is 5 hours; `--weekly` runs to a legacy tier's reset
469
+ day, else 7 days. `--until` takes a future ISO time or a duration such as `90m` or `1w2d`.
470
+ - In a v1 config whose `--tiers` plan locks only the scarce pool, `--5h` on a provider locks that
471
+ pool.
225
472
  - Reset times parsed from rate-limit messages are capped at 14 days. A manual `--until` is not capped.
226
473
  - `status` drops expired locks and prints the rest.
227
- - `clear <provider>` removes its provider and heavy-tier locks, not its model locks.
228
- `clear <model>` removes that model's lock. `--all` deletes the file, even a corrupt one.
474
+ - `clear <provider>` (or `clear provider:<provider>`) removes its provider and pool locks, not its model locks. `clear <model>`
475
+ removes that model's lock. `--all` deletes the file, even a corrupt one.
229
476
  - `check` runs `claude auth status` and `codex login status` (Antigravity has no status command). It
230
477
  reports login state only, unless the output explicitly says usage is exhausted; only then does it
231
478
  record a lock.
232
479
 
233
480
  ### Cooldown file
234
481
 
235
- `<config dir>/auto-build-cooldowns.json` is a JSON object keyed `model:<id>`, `provider:<p>` or
236
- `tier:<p>:heavy`:
482
+ `<config dir>/auto-build-cooldowns.json` is a JSON object with these keys:
483
+
484
+ | Key | Locks |
485
+ |---|---|
486
+ | `model:<id>` | The model on every hosting. |
487
+ | `model:<provider>:<id>` | That hosting only. |
488
+ | `provider:<p>` | The provider. Locking `claude` does not block `antigravity:claude-opus-5-5`. |
489
+ | `tier:<p>:<pool>` | One pool (`[a-z0-9-]+`), such as `tier:antigravity:third-party-claude`. |
490
+
491
+ Legacy `tier:<p>:heavy` keys are still read, and `quota check` or a probe may still write them.
237
492
 
238
493
  ```json
239
494
  {
240
- "provider:codex": {
241
- "scope": "provider",
242
- "window": "5h",
495
+ "tier:codex:astra": {
496
+ "scope": "tier",
497
+ "tier": "astra",
498
+ "window": "weekly",
243
499
  "until": "2030-01-01T05:00:00.000Z",
244
- "reason": "manual lock (5h)",
500
+ "reason": "manual lock (weekly)",
245
501
  "source": "manual"
246
502
  }
247
503
  }
248
504
  ```
249
505
 
250
- `scope` is `model`, `provider` or `tier` (written tier entries also carry `"tier": "heavy"`).
251
- `window` is `burst`, `5h`, `weekly` or `custom`. Legacy `until_utc` is read. A key without a prefix
252
- needs a `scope` field, or it locks nothing. A malformed entry (such as one without a valid time) is
253
- skipped with a warning and kept in the file until it is overwritten or cleared (`quota clear <name>`
254
- or `--all`). A file that is not a JSON object is unreadable: hooks warn and ignore it. A write that
255
- leaves no entries removes the file.
506
+ `scope` is `model`, `provider` or `tier`. `window` is `burst`, `5h`, `weekly` or `custom`. Legacy
507
+ `until_utc` is read. Long locks also carry `setAt` and `recheckAfter` (see [lock rechecks](#lock-rechecks)). A key without a prefix needs a `scope` field, or it locks nothing. A malformed
508
+ entry (such as one without a valid time) is skipped with a warning and kept in the file until it is
509
+ overwritten or cleared (`quota clear <name>` or `--all`). A file that is not a JSON object is
510
+ unreadable: hooks warn and ignore it. A write that leaves no entries removes the file.
256
511
 
257
512
  ## Configuration
258
513
 
259
- `<config dir>/auto-build.config.json` holds `allowlist` (provider to model names), `bannedModels`,
260
- `defaultModel`, `defaultEffort`, `ladders` and `compactionThreshold`, plus optional `tiers`,
261
- `modelIds` (display name to CLI model id) and `planRestricted`. Edit it, then run `init` again to
262
- re-render the skill. The hooks read it when they need it.
263
-
264
- - The existing file is always the base. `--compaction` overrides its value. A `--preset` that differs
265
- from the file's `preset` replaces the allowlist, ladders and default model and effort, and keeps
266
- your banned models and threshold. Banned models typed at the prompt are added.
267
- - To reset to a preset, delete the file and run `init`.
268
- - Banned entries match as case-insensitive substrings, and `A/B` bans both. A short entry such as
269
- `Claude` bans every model whose name contains it.
514
+ `<config dir>/auto-build.config.json`. A v2 config has `schemaVersion: 2` and:
515
+
516
+ | Keys | Meaning |
517
+ |---|---|
518
+ | `subscriptions`, `parent`, `preset` | Your tiers, parent model and effort, and a label. |
519
+ | `models` | `provider`, `model`, `pool`, `scarceQuota`, `family`, `version` per hosting. |
520
+ | `allowlist`, `ladders` | Provider to model ids; ordered `[provider:]model[@effort]` lists. |
521
+ | `retiredModels`, `planRestrictedModels`, `userBannedModels`, `bannedModels` | See [Model bans](#model-bans). |
522
+ | `allowFastModes`, `allowUsageCredits`, `verifiedOrg` | Switches, `false` by default. |
523
+ | `maxParallelBuilders`, `defaultModel`, `defaultEffort`, `compactionThreshold` | Run settings. |
524
+ | `modelIds`, `discovery` | Display name to CLI id; drift adapters. |
525
+
526
+ A v1 config has no `schemaVersion` and may also use `tiers` and `planRestricted`.
527
+
528
+ - The existing file is always the base. Re-run `init` after editing to re-render the skill. The hooks
529
+ read the file when they need it.
530
+ - Changing tiers (or usage credits) rebuilds `models`, `allowlist` and `ladders`, after a backup. It
531
+ keeps your bans, switches, threshold, effort, `modelIds` and `discovery`.
532
+ - `--compaction` overrides the file. In a v1 config, a `--preset` that differs from the file's
533
+ replaces the allowlist, ladders and default model and effort. Banned models typed at the prompt are
534
+ added.
535
+ - To start over, delete the file and run `init`.
270
536
  - Model names ignore case and punctuation runs, so `claude-sonnet-5-5` matches `Claude Sonnet 5.5`.
271
- Model cooldown keys may use either form. Provider cooldowns match the config provider name or the
272
- T3 provider id (`claudeAgent`, `codex`, `antigravity`). `provider:codex` also covers a custom
273
- instance such as `codex-2`; `provider:codex-2` covers only that instance.
274
- - Keys missing from the file come from its `preset` (`tri-provider` when unset).
275
- - Ladder entries are `Model` or `Model@effort`. Rendering drops banned and non-allowlisted entries.
276
- If a ladder ends up empty, `init` fails and writes nothing.
537
+ Provider cooldowns match the provider name or the T3 provider id (`claudeAgent`, `codex`,
538
+ `antigravity`). `provider:codex` also covers a custom instance such as `codex-2`;
539
+ `provider:codex-2` covers only that instance.
540
+ - Keys missing from the file come from its `preset` (`tri-provider` when unset or `custom`). The
541
+ hooks fall back to full defaults on an unknown `schemaVersion`.
542
+ - Rendering drops banned and non-allowlisted ladder entries. If a ladder ends up empty, `init` fails
543
+ and writes nothing.
277
544
  - The skill gets one `--<provider>-only` flag per allowlisted provider.
278
545
 
279
546
  ## What `init` touches
@@ -281,13 +548,13 @@ re-render the skill. The hooks read it when they need it.
281
548
  - Files that exist and differ from what was installed are skipped with a warning. This includes hook
282
549
  files, which are still wired. `--force` backs them up first (`.bak`, then `.bak.1`, so an earlier
283
550
  backup is never overwritten).
284
- - `settings.json`: only the four tagged hook entries and `env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`. Other
285
- keys and hooks are preserved. `settings.json.bak` is written only when the content changes. Invalid
286
- JSON stops the run before any write.
551
+ - `settings.json`: only the four tagged hook entries, `env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` and, with
552
+ a parent model, `model` and `effortLevel`. Other keys and hooks are preserved. `settings.json.bak`
553
+ is written only when the content changes. Invalid JSON stops the run before any write.
287
554
  - Paths that go through a symlink or junction inside the config directory are not written or
288
555
  deleted. A symlinked `settings.json` is updated through the link.
289
- - `t3-auto-build.manifest.json` records installed file hashes and the prior environment value.
290
- `uninstall` restores that value only if it is still the one installed.
556
+ - `t3-auto-build.manifest.json` records installed file hashes and prior setting values. `uninstall`
557
+ restores a value only if it is still the one installed.
291
558
  - A target path containing `"`, `$`, a backtick or `%` is refused, because it cannot be quoted
292
559
  safely in a hook command.
293
560
 
@@ -297,13 +564,14 @@ Installed to `<config dir>/hooks/t3-auto-build/`. Matching is case-insensitive.
297
564
 
298
565
  | Hook | Event | Behavior |
299
566
  |---|---|---|
300
- | `session-start.mjs` | SessionStart | Prunes expired cooldowns (deletes the file when none are left) and summarizes active ones. |
301
- | `pre-compact.mjs` | PreCompact | Prints the preservation rules, the saved orchestrator state if present (marked as data only, not instructions), and a `git status --short` snapshot (20 files at most). |
567
+ | `session-start.mjs` | SessionStart | Prints up to 6 lines: subscriptions (or an upgrade hint), active locks, cache freshness, drift counts. Prunes expired cooldowns. |
568
+ | `pre-compact.mjs` | PreCompact | Prints the preservation rules (allowlist, bans, restrictions, scarce pools, locks), the saved orchestrator state if present (marked as data only, not instructions), and a `git status --short` snapshot (20 files at most). |
302
569
  | `pre-tool-use.mjs` | PreToolUse | Exits 2 with a reason when a guard below matches. |
303
570
  | `post-tool-use.mjs` | PostToolUse | Formats the edited file with `biome` or `prettier`, `ruff`, or `gofmt` when on `PATH`. Never blocks. |
304
571
 
305
572
  PreToolUse guards:
306
573
 
574
+ - **Invalid payload:** a named tool whose `tool_input` is present but not an object is blocked.
307
575
  - **Secret files** (`Edit`, `Write`, `MultiEdit`): `.env` and `.env.*`, `.pem`, `.key`, `.p12`,
308
576
  `.pfx`, and paths containing `id_rsa` or `id_ed25519`.
309
577
  - **Git** (`Bash`): `git push --force`/`-f` and `git reset --hard`.
@@ -311,15 +579,13 @@ PreToolUse guards:
311
579
  when a target starts with `/`, `\`, `~`, a drive path such as `C:/`, `$HOME` or `%USERPROFILE%`;
312
580
  contains a command substitution; is the current directory or `*`; has a `..` or `.git` segment; or
313
581
  is a dot-file glob such as `.*`.
314
- - **Delegate models** (`delegate_task`): banned or non-allowlisted models are blocked. A trailing
315
- `-YYYYMMDD` snapshot suffix is ignored when matching.
316
- - **Lockouts** (`delegate_task`): model, provider and heavy-tier cooldowns block the call. Without a
317
- `provider`, `providerInstanceId` or `driverKind`, the provider is inferred from a `claude-`,
318
- `gpt-` or `gemini-` model name.
582
+ - **Delegate calls** (`delegate_task`), in order: [speed mode](#speed-mode-guard), provider/model
583
+ conflict, retired, user-banned, plan-restricted, availability, allowlist (a trailing `-YYYYMMDD`
584
+ suffix is ignored), then cooldown locks.
319
585
 
320
- Hooks fail open: malformed input or cooldown data produces a warning and exit 0. An invalid config
321
- produces a warning and falls back to preset defaults, so the allowlist is still enforced. The secret
322
- and destructive-command guards need no config.
586
+ Empty or unparsable hook input, and unreadable cooldown data, produce exit 0 (fail open). An invalid
587
+ config value produces a warning and a default, so the allowlist is still enforced. The secret and
588
+ destructive-command guards need no config.
323
589
 
324
590
  ### Known limits
325
591
 
@@ -331,8 +597,8 @@ and destructive-command guards need no config.
331
597
  - Any `-f` text after `git push` matches, including a branch name such as `bug-fix`.
332
598
  `--force-with-lease` is blocked too.
333
599
  - The delegate guard reads `model` and the provider fields at the top level of `tool_input` and under
334
- `target` (T3 Code's shape). A call without a model skips the allowlist check; provider cooldowns
335
- still apply if it names a provider.
600
+ `target` (T3 Code's shape). A call without a model skips the model checks; the speed-mode guard and
601
+ provider cooldowns still apply.
336
602
 
337
603
  Not ported from the PowerShell hooks: `stop-verify.js`, `bash-guard.js`, `tsc-check.js`, the caveman status line and
338
604
  skillspector. No Stop hook is installed.
@@ -343,16 +609,16 @@ they are still wired.
343
609
  ## Security and privacy
344
610
 
345
611
  - No runtime dependencies. The package's own code makes no network requests and has no telemetry.
346
- - It does run provider CLIs, which may use the network: `sync-models` and `init --probe` send live
347
- prompts, and `quota check` runs their login status commands. See [sync-models](#sync-models) for
348
- billing and environment caveats.
612
+ - It does run provider CLIs, which may use the network: `check-models`, `sync-models` and
613
+ `init --probe` send live prompts, `check-models` also runs their `--version` and your `discovery`
614
+ commands, and `quota check` runs their login status commands.
615
+ - `discovery` commands run with your permissions. Add only commands you trust.
349
616
  - Provider detection only checks that config folders exist; it opens nothing inside them.
350
617
  - Probes run in an empty temp directory, and the cooldown reasons they record never quote CLI output.
351
618
  - Commands are resolved from absolute `PATH` entries, never the current directory.
352
619
  - Install and uninstall protect your edits and refuse symlinked paths inside the config directory,
353
620
  with the exceptions described in [What `init` touches](#what-init-touches).
354
- - Guard hooks fail open and have [known limits](#known-limits). Do not rely on them as a security
355
- boundary.
621
+ - Guard hooks have [known limits](#known-limits). Do not rely on them as a security boundary.
356
622
 
357
623
  Report vulnerabilities as described in [SECURITY.md](https://github.com/mirceas94/t3-auto-build/blob/main/SECURITY.md). To contribute,
358
624
  see [CONTRIBUTING.md](https://github.com/mirceas94/t3-auto-build/blob/main/CONTRIBUTING.md).