t3-auto-build 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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,196 @@
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` | no | – | – | 0 | desktop-only; Codex CLI unavailable |
88
+ | codex | `go` | no | – | – | 0 | desktop-only; Codex CLI unavailable |
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
+
157
+ ```sh
158
+ t3-auto-build availability mark antigravity:claude-opus-5-5 plan-restricted --ttl 24h --reason "not in plan"
159
+ t3-auto-build availability status
160
+ ```
161
+
162
+ ### Model drift
163
+
164
+ No provider CLI listing is built in. To detect new or missing models, add an adapter per provider to
165
+ the config: an argv array whose stdout is a JSON array or a newline list of model ids.
166
+
167
+ ```json
168
+ { "discovery": { "codex": ["node", "<absolute path>/list-codex-models.mjs"] } }
169
+ ```
170
+
171
+ `list-codex-models.mjs` is a placeholder for your own script. Adapters run in an empty temp
172
+ directory, so use absolute paths. `check-models` then reports ids that
173
+ are not configured, and configured native models the adapter did not list. Nothing is allowed
174
+ automatically. To adopt newer versions:
175
+
176
+ ```sh
177
+ t3-auto-build check-models
178
+ t3-auto-build sync-models --apply
179
+ ```
180
+
181
+ `--apply` runs no probes. It reads the availability cache and replaces a configured model with a
182
+ newer version of the same family, keeping its pool and ladder position. Retired, banned and
183
+ plan-restricted ids are never promoted; unknown families are reported and stay disabled. It backs up
184
+ the config and re-renders `SKILL.md`. It needs an `auto-build` or `full` install.
185
+
186
+ ## Model bans
187
+
188
+ Three layers apply to `delegate_task` calls.
189
+
190
+ | Layer | Source | Can you remove it? |
191
+ |---|---|---|
192
+ | Retired | built in, plus `retiredModels` | Not the built-in entries. Config can only add. |
193
+ | Plan-restricted | `planRestrictedModels` (`provider:model` or bare model) and live availability entries | Change tiers, or let the mark expire or replace it |
194
+ | User-banned | `userBannedModels` / `bannedModels` | Yes, edit both lists in the config |
195
+
196
+ Built-in retired patterns: `gemini-4-argon`, `gemini-3.8-flash`, `claude-4.6`, `claude-4.6-*`,
197
+ `gpt-5.4`, `gpt-5.4-*`, `gpt-5.5`, `gpt-5.5-*`. Matching treats `.` and `-` alike, accepts display
198
+ names (`GPT 5.4 Mini`) and ignores a trailing date. A `-*` pattern covers the stem and its suffixed
199
+ variants; `gpt-5.40` does not match `gpt-5.4`.
200
+
201
+ User bans match as case-insensitive substrings, and `A/B` bans both. A short entry such as `Claude`
202
+ bans every model whose name contains it.
203
+
204
+ ## Speed-mode guard
205
+
206
+ Unless the config has `"allowFastModes": true`, a `delegate_task` call is blocked when a key matching
207
+ `fast`, `speed` or `serviceTier` is `true`, `fast`, `ultrafast` or `priority`. Set it with
208
+ `init --allow-fast-modes`.
53
209
 
54
210
  ## auto-build workflow
55
211
 
@@ -71,12 +227,14 @@ flowchart TD
71
227
  verify -->|"passed"| report["Optional commit and report"]
72
228
  ```
73
229
 
74
- 1. **Step 0:** check lockouts, record the `git status` baseline, resume if asked.
230
+ 1. **Step 0:** run `t3-auto-build check-models`, check lockouts and restrictions, record the
231
+ `git status` baseline, resume if asked.
75
232
  2. **Triage:** write a short `REPO_BRIEF` (using the cached `.claude/repo-profile.md`) and pick the
76
233
  level `L0` to `L3` and work shape `A` (multi-file, UI) or `B` (algorithms, debugging).
77
234
  3. **Plan** (`L2`/`L3`), cross-checked by another provider on `L3` when available.
78
235
  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.
236
+ run in parallel, at most `maxParallelBuilders` at once; the diff guard and exit checks pass before
237
+ the next wave.
80
238
  5. **Verify:** blind edge-case tests (`L2`/`L3`), tests and lint, a diff-only audit preferring
81
239
  another provider (two auditors on `L3`), at most 2 fix rounds, then an optional commit and a
82
240
  report.
@@ -102,33 +260,73 @@ resume later.
102
260
 
103
261
  ## CLI
104
262
 
263
+ ```text
264
+ t3-auto-build init
265
+ t3-auto-build upgrade [--yes]
266
+ t3-auto-build check-models [--refresh] [--probe-scarce] [--json]
267
+ t3-auto-build sync-models [--auto] [--refresh] [--probe-scarce] [--apply]
268
+ t3-auto-build availability mark <provider:model> <available|plan-restricted|unavailable> [--ttl 24h] [--reason <text>]
269
+ t3-auto-build availability status
270
+ t3-auto-build quota set <subject>
271
+ t3-auto-build quota status
272
+ t3-auto-build quota clear [subject]
273
+ t3-auto-build quota check [provider]
274
+ t3-auto-build doctor
275
+ t3-auto-build uninstall
276
+ ```
277
+
105
278
  | Command | What it does |
106
279
  |---|---|
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. |
280
+ | `init` | Installs or updates. Interactive unless `--yes`. |
281
+ | `upgrade` | Converts a v1 config to v2. Never prompts. |
282
+ | `check-models` | Prunes expired state, runs discovery, probes if the cache is stale. |
283
+ | `sync-models` | Probes models and updates the allowlist, or applies drift with `--apply`. |
284
+ | `availability mark\|status` | Sets or shows model availability. |
285
+ | `quota set\|status\|clear\|check` | Manages cooldown locks. |
286
+ | `doctor` | Checks files, config, hook wiring, cache age, tiers against CLI binaries, drift and optional tools. |
287
+ | `uninstall` | Removes what `init` installed and the availability cache. Keeps files you changed and the cooldown file. |
112
288
 
113
289
  | Option | Applies to | Meaning |
114
290
  |---|---|---|
115
291
  | `--target <dir>` | all | Config directory. Default: `$CLAUDE_CONFIG_DIR`, else `~/.claude`. |
116
- | `--preset <name>` | init | `tri-provider`, `claude-codex` or `claude-only`. |
292
+ | `-h`, `--help` | all | Show the usage text. |
293
+ | `-v`, `--version` | no command | Print the version. |
294
+ | `--yes` | init, upgrade, sync-models | No prompts. Without an interactive terminal, `init` requires it, and `sync-models` requires it, `--auto` or `--dry-run`. |
295
+ | `--preset <name>` | init | `tri-provider`, `claude-codex` or `claude-only`. Legacy configs only. |
117
296
  | `--modules <name>` | init | `full`, `auto-build` or `core`. |
118
297
  | `--compaction <n>` | init | Integer from 1 to 100. |
119
- | `--tiers <list>` | init | `provider:plan[:weekday]`, comma separated. |
298
+ | `--tiers <list>` | init | Legacy `provider:plan[:weekday]` list. Ignored for v2 configs. |
299
+ | `--claude-tier <tier>` | init | `none`, `free`, `pro`, `max`, `ultra`, `team-standard`, `team-premium`, `api`. |
300
+ | `--codex-tier <tier>` | init | `none`, `free`, `go`, `plus`, `pro-100`, `pro-200`, `pro-500`, `business`, `api`. |
301
+ | `--antigravity-tier <tier>` | init | `none`, `free`, `plus`, `pro-trial`, `pro`, `ultra-5x`, `ultra-20x`. |
302
+ | `--parent <model>` | init | `sonnet`, `opus` or `fable`. See [parent model](#parent-model). |
303
+ | `--allow-usage-credits` | init | Include per-token `api` tiers. Needs a tier or a v2 config. |
304
+ | `--allow-fast-modes` | init | Permit fast or priority service modes. Needs a tier or a v2 config. |
305
+ | `--verified-org` | init | Record `verifiedOrg: true` in a v2 config. No routing or hook reads it. |
120
306
  | `--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
307
  | `--force` | init, sync-models | Back up your changed files to `<file>.bak`, then overwrite. For `sync-models`, this covers a hand-edited `SKILL.md`. |
308
+ | `--refresh` | check-models, sync-models | Ignore the probe cache TTL. `sync-models` without `--apply` always probes. |
309
+ | `--probe-scarce` | check-models, sync-models | Also probe scarce-pool models. |
310
+ | `--json` | check-models | Machine-readable result. |
311
+ | `--auto` | sync-models | Write without confirmation, like `--yes`. |
312
+ | `--apply` | sync-models | Promote newer versions from recorded drift. |
123
313
  | `--dry-run` | sync-models | Probe and print the result; write nothing. **Still spends real quota.** |
124
314
  | `--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). |
315
+ | `--ttl <duration>` | availability mark | `1m` to `30d`, default `24h`. |
316
+ | `--pool <name>` | quota set | Lock a pool: `standard`, `fable`, `astra`, `third-party-claude`, or another lowercase name. |
317
+ | `--burst`, `--5h`, `--weekly`, `--until <when>` | quota set | Lock window; one only. Default `--burst`. |
318
+ | `--reason <text>` | quota set, availability mark | Note shown by the status command. |
126
319
  | `--all` | quota clear | Remove every lock. |
127
- | `--version`, `-v` | no command | Print the version. |
128
- | `-h`, `--help` | all | Show the usage text. |
129
320
 
130
321
  Exit codes: `0` success, `1` failure (invalid JSON, broken install), `2` usage error.
131
322
 
323
+ ```sh
324
+ t3-auto-build init --claude-tier pro --codex-tier plus --antigravity-tier pro --parent opus
325
+ t3-auto-build check-models --json
326
+ t3-auto-build sync-models --refresh --probe-scarce
327
+ t3-auto-build quota set antigravity:claude-opus-5-5 --pool third-party-claude
328
+ ```
329
+
132
330
  ### Modules
133
331
 
134
332
  | `--modules` | Name | CLAUDE.md, rules, commands | Skill, config, hooks, `settings.json` |
@@ -139,17 +337,12 @@ Exit codes: `0` success, `1` failure (invalid JSON, broken install), `2` usage e
139
337
 
140
338
  A re-run without `--modules` keeps the previous choice. When you change it, `init` removes the files
141
339
  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
340
+ the hook entries and the values `init` set in `settings.json`. That cleanup is the one case where a
143
341
  `core` run writes `settings.json`.
144
342
 
145
- ## Presets and safety guards
146
-
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).
343
+ ## Legacy presets
151
344
 
152
- ### Preset matrix
345
+ Without subscription tiers, `init` writes a v1 config from a preset.
153
346
 
154
347
  | Preset | Models | Codex | Antigravity | Claude | Dual audit |
155
348
  |---|---|---|---|---|---|
@@ -157,44 +350,78 @@ non-allowlisted or locked models. They are a safety net, not a sandbox: see [Hoo
157
350
  | `claude-codex` | 6 | 3 | 0 | 3 | Claude Opus 5.5 + gpt-6-luna |
158
351
  | `claude-only` | 3 | 0 | 0 | 3 | Claude Opus 5.5 + Claude Sonnet 5.5 |
159
352
 
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%.
353
+ Every preset defaults to Claude Sonnet 5.5 at `medium` effort and sets the auto-compaction threshold
354
+ to 35%. Presets ban no models of their own; the [retired list](#model-bans) always applies.
162
355
 
163
- ### Provider detection and tiers
356
+ Interactive `init` on a fresh target suggests tiers (Claude `pro`, Codex `plus`, Antigravity `plus`)
357
+ for the `claude`, `codex` and `antigravity` binaries on `PATH`. If you choose `none` everywhere, it
358
+ asks for a preset. Provider config folders are only checked for existence. `init --yes` does not
359
+ detect: a fresh install without `--preset` or a tier uses `tri-provider`.
164
360
 
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`.
361
+ `--tiers provider:plan[:weekday]` (for example `claude:max:monday,codex:plus`) records how limits are
362
+ shared in a v1 config.
170
363
 
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.
174
-
175
- | Provider | Plan: short-window limit locks the provider | Plan: locks only the heavy model | Heavy model |
364
+ | Provider | Plan: short-window limit locks the provider | Plan: locks only the scarce pool | Pool |
176
365
  |---|---|---|---|
177
- | `claude` | `pro` | `max` | Claude Opus 5.5 |
178
- | `codex` | `plus` | `pro` | gpt-6-luna |
179
- | `antigravity` | `standard` | `ultra` | Gemini 4 Carbon |
366
+ | `claude` | `pro` | `max` | `fable` |
367
+ | `codex` | `plus` | `pro` | `astra` |
368
+ | `antigravity` | `standard` | `ultra` | `third-party-claude` |
369
+
370
+ The weekday (`monday` or `mon`) is the weekly reset day, taken as 00:00 UTC.
371
+
372
+ ## Migrating from v1
373
+
374
+ v1 configs keep loading, with the retired list enforced. To convert:
375
+
376
+ 1. Run the v2 package:
377
+
378
+ ```sh
379
+ npx t3-auto-build@latest upgrade
380
+ ```
381
+
382
+ 2. `upgrade` assumes low paid tiers, because a v1 config does not say what you pay for: Claude `pro`,
383
+ Codex `plus`, Antigravity `plus` for each provider in your allowlist, else `none`.
384
+ 3. Set your real tiers:
385
+
386
+ ```sh
387
+ npx t3-auto-build init --claude-tier max --codex-tier pro-200 --antigravity-tier pro
388
+ ```
389
+
390
+ Until then no scarce or cross-hosted model is configured.
391
+ 4. Restart T3 Code.
392
+
393
+ What `upgrade` does:
394
+
395
+ - Backs up `auto-build.config.json` to `.bak` (`.bak.1` and so on if a different backup exists).
396
+ - Moves your `bannedModels` to `userBannedModels`, dropping the old defaults `Argon` and
397
+ `Fable/Mythos`. `bannedModels` mirrors the list.
398
+ - Keeps `compactionThreshold`, `defaultEffort`, `modelIds` and `discovery`. Ladder entries still in
399
+ the new roster stay in place; others are replaced.
400
+ - Rebuilds the rest from the tiers. Custom allowlist entries, `defaultModel`, `planRestricted` and
401
+ `tiers` are not carried over.
402
+ - Re-renders the managed files you have not edited and updates `settings.json`, including `model` and
403
+ `effortLevel` when absent.
404
+ - Does nothing on a config that is already v2.
180
405
 
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.
406
+ Existing `tier:<provider>:heavy` cooldown keys are still read.
183
407
 
184
408
  ## sync-models
185
409
 
186
410
  > **`sync-models --dry-run` still executes live probes.** It spends real quota and writes nothing.
411
+ > The [API billing warning](#availability-checks) applies.
187
412
 
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
413
+ Candidates are the config allowlist, its `planRestricted` models and the preset's models (a `custom`
414
+ config uses the `tri-provider` preset). Banned models and, without `--probe-scarce`, scarce models
415
+ are not probed. Each other model gets a one-word prompt through `claude -p` or `codex exec`, in an
416
+ empty temp directory with a 20 s timeout. `claude` runs with tools disabled, safe mode and no session
194
417
  persistence. `codex` runs read-only and ephemeral with `--ignore-user-config` and `--ignore-rules`,
195
418
  so your Codex user config does not apply. Antigravity has no probe support: its models report
196
419
  `unavailable` and keep their current membership.
197
420
 
421
+ > On a v2 config, preset models count as candidates too. A successful probe can therefore add
422
+ > allowlist entries beyond your tier, including display-name duplicates. Review the changes before you
423
+ > confirm, or use `check-models` with `sync-models --apply`.
424
+
198
425
  | State | Effect on the config |
199
426
  |---|---|
200
427
  | `available` | Added to or kept in `allowlist`; removed from `planRestricted`. |
@@ -212,68 +439,91 @@ Writing needs an `auto-build` or `full` install; `--dry-run` needs only the conf
212
439
  ## Quota
213
440
 
214
441
  ```sh
215
- t3-auto-build quota set <claude|codex|antigravity|model> [--burst|--5h|--weekly|--until <when>] [--reason <text>]
442
+ t3-auto-build quota set <provider|model|provider:model> [--pool <name>] [--burst|--5h|--weekly|--until <when>] [--reason <text>]
216
443
  t3-auto-build quota status
217
- t3-auto-build quota clear <provider|model> # or --all
444
+ t3-auto-build quota clear <provider|model|provider:model> # or --all
218
445
  t3-auto-build quota check [provider]
219
446
  ```
220
447
 
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`.
448
+ - `set claude` locks the provider; `set claude-opus-5-5` locks that model on every hosting;
449
+ `set antigravity:claude-opus-5-5` locks that hosting only. With `--pool`, any of these locks that
450
+ pool of the provider instead (a bare model means its native provider).
451
+ - The default `--burst` is 10 minutes; `--5h` is 5 hours; `--weekly` runs to a legacy tier's reset
452
+ day, else 7 days. `--until` takes a future ISO time or a duration such as `90m` or `1w2d`.
453
+ - In a v1 config whose `--tiers` plan locks only the scarce pool, `--5h` on a provider locks that
454
+ pool.
225
455
  - Reset times parsed from rate-limit messages are capped at 14 days. A manual `--until` is not capped.
226
456
  - `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.
457
+ - `clear <provider>` removes its provider and pool locks, not its model locks. `clear <model>`
458
+ removes that model's lock. `--all` deletes the file, even a corrupt one.
229
459
  - `check` runs `claude auth status` and `codex login status` (Antigravity has no status command). It
230
460
  reports login state only, unless the output explicitly says usage is exhausted; only then does it
231
461
  record a lock.
232
462
 
233
463
  ### Cooldown file
234
464
 
235
- `<config dir>/auto-build-cooldowns.json` is a JSON object keyed `model:<id>`, `provider:<p>` or
236
- `tier:<p>:heavy`:
465
+ `<config dir>/auto-build-cooldowns.json` is a JSON object with these keys:
466
+
467
+ | Key | Locks |
468
+ |---|---|
469
+ | `model:<id>` | The model on every hosting. |
470
+ | `model:<provider>:<id>` | That hosting only. |
471
+ | `provider:<p>` | The provider. Locking `claude` does not block `antigravity:claude-opus-5-5`. |
472
+ | `tier:<p>:<pool>` | One pool (`[a-z0-9-]+`), such as `tier:antigravity:third-party-claude`. |
473
+
474
+ Legacy `tier:<p>:heavy` keys are still read, and `quota check` or a probe may still write them.
237
475
 
238
476
  ```json
239
477
  {
240
- "provider:codex": {
241
- "scope": "provider",
242
- "window": "5h",
478
+ "tier:codex:astra": {
479
+ "scope": "tier",
480
+ "tier": "astra",
481
+ "window": "weekly",
243
482
  "until": "2030-01-01T05:00:00.000Z",
244
- "reason": "manual lock (5h)",
483
+ "reason": "manual lock (weekly)",
245
484
  "source": "manual"
246
485
  }
247
486
  }
248
487
  ```
249
488
 
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.
489
+ `scope` is `model`, `provider` or `tier`. `window` is `burst`, `5h`, `weekly` or `custom`. Legacy
490
+ `until_utc` is read. A key without a prefix needs a `scope` field, or it locks nothing. A malformed
491
+ entry (such as one without a valid time) is skipped with a warning and kept in the file until it is
492
+ overwritten or cleared (`quota clear <name>` or `--all`). A file that is not a JSON object is
493
+ unreadable: hooks warn and ignore it. A write that leaves no entries removes the file.
256
494
 
257
495
  ## Configuration
258
496
 
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.
497
+ `<config dir>/auto-build.config.json`. A v2 config has `schemaVersion: 2` and:
498
+
499
+ | Keys | Meaning |
500
+ |---|---|
501
+ | `subscriptions`, `parent`, `preset` | Your tiers, parent model and effort, and a label. |
502
+ | `models` | `provider`, `model`, `pool`, `scarceQuota`, `family`, `version` per hosting. |
503
+ | `allowlist`, `ladders` | Provider to model ids; ordered `[provider:]model[@effort]` lists. |
504
+ | `retiredModels`, `planRestrictedModels`, `userBannedModels`, `bannedModels` | See [Model bans](#model-bans). |
505
+ | `allowFastModes`, `allowUsageCredits`, `verifiedOrg` | Switches, `false` by default. |
506
+ | `maxParallelBuilders`, `defaultModel`, `defaultEffort`, `compactionThreshold` | Run settings. |
507
+ | `modelIds`, `discovery` | Display name to CLI id; drift adapters. |
508
+
509
+ A v1 config has no `schemaVersion` and may also use `tiers` and `planRestricted`.
510
+
511
+ - The existing file is always the base. Re-run `init` after editing to re-render the skill. The hooks
512
+ read the file when they need it.
513
+ - Changing tiers (or usage credits) rebuilds `models`, `allowlist` and `ladders`, after a backup. It
514
+ keeps your bans, switches, threshold, effort, `modelIds` and `discovery`.
515
+ - `--compaction` overrides the file. In a v1 config, a `--preset` that differs from the file's
516
+ replaces the allowlist, ladders and default model and effort. Banned models typed at the prompt are
517
+ added.
518
+ - To start over, delete the file and run `init`.
270
519
  - 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.
520
+ Provider cooldowns match the provider name or the T3 provider id (`claudeAgent`, `codex`,
521
+ `antigravity`). `provider:codex` also covers a custom instance such as `codex-2`;
522
+ `provider:codex-2` covers only that instance.
523
+ - Keys missing from the file come from its `preset` (`tri-provider` when unset or `custom`). The
524
+ hooks fall back to full defaults on an unknown `schemaVersion`.
525
+ - Rendering drops banned and non-allowlisted ladder entries. If a ladder ends up empty, `init` fails
526
+ and writes nothing.
277
527
  - The skill gets one `--<provider>-only` flag per allowlisted provider.
278
528
 
279
529
  ## What `init` touches
@@ -281,13 +531,13 @@ re-render the skill. The hooks read it when they need it.
281
531
  - Files that exist and differ from what was installed are skipped with a warning. This includes hook
282
532
  files, which are still wired. `--force` backs them up first (`.bak`, then `.bak.1`, so an earlier
283
533
  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.
534
+ - `settings.json`: only the four tagged hook entries, `env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` and, with
535
+ a parent model, `model` and `effortLevel`. Other keys and hooks are preserved. `settings.json.bak`
536
+ is written only when the content changes. Invalid JSON stops the run before any write.
287
537
  - Paths that go through a symlink or junction inside the config directory are not written or
288
538
  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.
539
+ - `t3-auto-build.manifest.json` records installed file hashes and prior setting values. `uninstall`
540
+ restores a value only if it is still the one installed.
291
541
  - A target path containing `"`, `$`, a backtick or `%` is refused, because it cannot be quoted
292
542
  safely in a hook command.
293
543
 
@@ -297,13 +547,14 @@ Installed to `<config dir>/hooks/t3-auto-build/`. Matching is case-insensitive.
297
547
 
298
548
  | Hook | Event | Behavior |
299
549
  |---|---|---|
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). |
550
+ | `session-start.mjs` | SessionStart | Prints up to 6 lines: subscriptions (or an upgrade hint), active locks, cache freshness, drift counts. Prunes expired cooldowns. |
551
+ | `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
552
  | `pre-tool-use.mjs` | PreToolUse | Exits 2 with a reason when a guard below matches. |
303
553
  | `post-tool-use.mjs` | PostToolUse | Formats the edited file with `biome` or `prettier`, `ruff`, or `gofmt` when on `PATH`. Never blocks. |
304
554
 
305
555
  PreToolUse guards:
306
556
 
557
+ - **Invalid payload:** a named tool whose `tool_input` is present but not an object is blocked.
307
558
  - **Secret files** (`Edit`, `Write`, `MultiEdit`): `.env` and `.env.*`, `.pem`, `.key`, `.p12`,
308
559
  `.pfx`, and paths containing `id_rsa` or `id_ed25519`.
309
560
  - **Git** (`Bash`): `git push --force`/`-f` and `git reset --hard`.
@@ -311,15 +562,13 @@ PreToolUse guards:
311
562
  when a target starts with `/`, `\`, `~`, a drive path such as `C:/`, `$HOME` or `%USERPROFILE%`;
312
563
  contains a command substitution; is the current directory or `*`; has a `..` or `.git` segment; or
313
564
  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.
565
+ - **Delegate calls** (`delegate_task`), in order: [speed mode](#speed-mode-guard), provider/model
566
+ conflict, retired, user-banned, plan-restricted, availability, allowlist (a trailing `-YYYYMMDD`
567
+ suffix is ignored), then cooldown locks.
319
568
 
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.
569
+ Empty or unparsable hook input, and unreadable cooldown data, produce exit 0 (fail open). An invalid
570
+ config value produces a warning and a default, so the allowlist is still enforced. The secret and
571
+ destructive-command guards need no config.
323
572
 
324
573
  ### Known limits
325
574
 
@@ -331,8 +580,8 @@ and destructive-command guards need no config.
331
580
  - Any `-f` text after `git push` matches, including a branch name such as `bug-fix`.
332
581
  `--force-with-lease` is blocked too.
333
582
  - 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.
583
+ `target` (T3 Code's shape). A call without a model skips the model checks; the speed-mode guard and
584
+ provider cooldowns still apply.
336
585
 
337
586
  Not ported from the PowerShell hooks: `stop-verify.js`, `bash-guard.js`, `tsc-check.js`, the caveman status line and
338
587
  skillspector. No Stop hook is installed.
@@ -343,16 +592,16 @@ they are still wired.
343
592
  ## Security and privacy
344
593
 
345
594
  - 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.
595
+ - It does run provider CLIs, which may use the network: `check-models`, `sync-models` and
596
+ `init --probe` send live prompts, `check-models` also runs their `--version` and your `discovery`
597
+ commands, and `quota check` runs their login status commands.
598
+ - `discovery` commands run with your permissions. Add only commands you trust.
349
599
  - Provider detection only checks that config folders exist; it opens nothing inside them.
350
600
  - Probes run in an empty temp directory, and the cooldown reasons they record never quote CLI output.
351
601
  - Commands are resolved from absolute `PATH` entries, never the current directory.
352
602
  - Install and uninstall protect your edits and refuse symlinked paths inside the config directory,
353
603
  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.
604
+ - Guard hooks have [known limits](#known-limits). Do not rely on them as a security boundary.
356
605
 
357
606
  Report vulnerabilities as described in [SECURITY.md](https://github.com/mirceas94/t3-auto-build/blob/main/SECURITY.md). To contribute,
358
607
  see [CONTRIBUTING.md](https://github.com/mirceas94/t3-auto-build/blob/main/CONTRIBUTING.md).