burnoff 1.4.0 → 1.4.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/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/burnoff-pr-gate.yml +3 -3
- package/.github/workflows/burnoff-startup-lint.yml +2 -2
- package/README.md +213 -209
- package/bin/burnoff.mjs +1 -1
- package/commands/burnoff.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +6 -6
- package/docs/DESIGN_PARTNER_INTAKE.md +3 -3
- package/hooks/hook-io.mjs +691 -599
- package/package.json +1 -1
- package/scripts/bench-hooks.mjs +252 -0
- package/src/cli/doctor.mjs +583 -462
- package/src/cli/hook-health.mjs +429 -0
- package/src/cli/init.mjs +668 -646
- package/src/clients/antigravity.mjs +285 -285
- package/src/config/policy.mjs +307 -306
- package/src/guards/credential-scrubber.mjs +185 -0
- package/src/guards/loop-breaker.mjs +797 -793
- package/src/guards/post-tool-engine.mjs +875 -854
- package/src/guards/pre-tool-engine.mjs +973 -978
- package/src/guards/read-clamp.mjs +826 -804
- package/src/guards/shell-guard.mjs +1705 -1676
- package/src/guards/structural-boundaries.mjs +175 -0
- package/src/ipc/fast-client.mjs +255 -255
- package/src/storage/fts5-archive.mjs +734 -733
|
@@ -30,13 +30,13 @@ jobs:
|
|
|
30
30
|
if [ -s .burnoff-ci/provider-usage.json ]; then
|
|
31
31
|
USAGE_FLAG="--provider-usage .burnoff-ci/provider-usage.json"
|
|
32
32
|
fi
|
|
33
|
-
npx -y burnoff@1.4.
|
|
34
|
-
npx -y burnoff@1.4.
|
|
33
|
+
npx -y burnoff@1.4.1 pr-cost --base "origin/${{ github.base_ref }}" $USAGE_FLAG --json --out .burnoff-ci/pr-cost.json
|
|
34
|
+
npx -y burnoff@1.4.1 pr-cost --base "origin/${{ github.base_ref }}" $USAGE_FLAG --markdown --out .burnoff-ci/pr-cost.md
|
|
35
35
|
|
|
36
36
|
- name: Enforce CI Token-Budget Gate
|
|
37
37
|
id: gate
|
|
38
38
|
run: |
|
|
39
|
-
npx -y burnoff@1.4.
|
|
39
|
+
npx -y burnoff@1.4.1 ci-gate --input .burnoff-ci/pr-cost.json --strict --github-annotations --out .burnoff-ci/ci-gate.md
|
|
40
40
|
cat .burnoff-ci/pr-cost.md >> "$GITHUB_STEP_SUMMARY"
|
|
41
41
|
cat .burnoff-ci/ci-gate.md >> "$GITHUB_STEP_SUMMARY"
|
|
42
42
|
echo "summary_path=.burnoff-ci/pr-cost.md" >> "$GITHUB_OUTPUT"
|
|
@@ -27,11 +27,11 @@ jobs:
|
|
|
27
27
|
node-version: '22'
|
|
28
28
|
|
|
29
29
|
- name: Run Repo-Local Turn-0 Startup Audit
|
|
30
|
-
# External consumers copying this workflow can use npx -y burnoff@1.4.
|
|
30
|
+
# External consumers copying this workflow can use npx -y burnoff@1.4.1 directly.
|
|
31
31
|
run: |
|
|
32
32
|
if [ -f bin/burnoff.mjs ]; then
|
|
33
33
|
node bin/burnoff.mjs audit --startup --ci --github-annotations --client auto | tee burnoff-startup-lint.txt
|
|
34
34
|
else
|
|
35
|
-
npx -y burnoff@1.4.
|
|
35
|
+
npx -y burnoff@1.4.1 audit --startup --ci --github-annotations --client auto | tee burnoff-startup-lint.txt
|
|
36
36
|
fi
|
|
37
37
|
cat burnoff-startup-lint.txt >> "$GITHUB_STEP_SUMMARY"
|
package/README.md
CHANGED
|
@@ -1,209 +1,213 @@
|
|
|
1
|
-
# Burnoff
|
|
2
|
-
|
|
3
|
-
**Burnoff** — Deterministic circuit breakers, bounded file-read guards, and Turn-0 config linting for Claude Code (with experimental Google Antigravity CLI support).
|
|
4
|
-
|
|
5
|
-
Burnoff runs locally via `PreToolUse` and `PostToolUse` hooks to bound oversized file reads (`updatedInput`), stop runaway command failure loops, block destructive shell/git operations and credential reads, and statically lint Turn-0 repository config bloat (`CLAUDE.md`/`AGENTS.md`, `.mcp.json`, volatile prompt-prefix instructions `BO-CFG-11`). Zero runtime dependencies, MIT licensed, 100% local, and no proxy or daemon required.
|
|
6
|
-
|
|
7
|
-
## Why Burnoff?
|
|
8
|
-
|
|
9
|
-
- **Bounded File-Read Guards (`DET-06`):** Clamps oversized non-code reads (`250 lines / 16 KB`) via `updatedInput`, skips overlapping re-reads, and leaves active source files unclamped.
|
|
10
|
-
- **Deterministic Runaway Loop Breaker (`DET-04`):** Halts repeating tool or command failure loops after 3 consecutive failures using cross-process state locking, exempting read-only recovery steps and resetting cleanly on success or `git stash`.
|
|
11
|
-
- **Destructive Shell & Credential Guards (`DET-01` / `DET-02` / `DET-03`):** Blocks high-risk shell/git commands (`git push --force`, `--no-verify`, `rm -rf`) and sensitive credential/env paths (allowing `.env.example`/`.env.sample` templates), while routing reversible git resets and lockfile/workflow edits through interactive confirmation.
|
|
12
|
-
- **Turn-0 Startup Config Linter (`audit --startup`):** Audits `.mcp.json`, Claude Code settings, `.agents/mcp_config.json`, `GEMINI.md`/`AGENTS.md`/`.agents/rules/*.md`, volatile prompt-prefix instructions (`BO-CFG-11`), and tool bloat before a session starts.
|
|
13
|
-
- **Repo Policy & Local FinOps (`pr-cost` / `ci-gate`):** Correlates branch commits with local Claude Code and Google Antigravity CLI session transcripts, optionally reconciles against `.burnoff-ci/provider-usage.json`, and evaluates `.burnoff.yaml` thresholds via `ci-gate`.
|
|
14
|
-
|
|
15
|
-
## Requirements & Scope
|
|
16
|
-
|
|
17
|
-
- **Supported Agents:** **Claude Code** and **Google Antigravity CLI (experimental)**.
|
|
18
|
-
- **Runtime:** **Node.js `>=20.19.0`** (`Node.js >=22.13.0` recommended for built-in `node:sqlite` FTS5 indexing; older supported Node.js versions automatically run in local JSON fallback mode).
|
|
19
|
-
- **Dependencies:** **Zero runtime npm dependencies.**
|
|
20
|
-
|
|
21
|
-
### Client Capability Matrix
|
|
22
|
-
|
|
23
|
-
| Capability | Claude Code | Google Antigravity CLI (experimental) |
|
|
24
|
-
| :--- | :---: | :---: |
|
|
25
|
-
| **DET-01 / 02 / 03** (Shell, secret & protected-file guards) | Yes | Yes (`decision: deny \| ask`) |
|
|
26
|
-
| **DET-04** (Runaway loop breaker) | Yes (`PostToolUse` / `PostToolUseFailure`) | Yes (`PostToolUse.error`) |
|
|
27
|
-
| **DET-05** (Subagent fan-out & prompt-bloat guard) | Yes (`Task` / `Agent`, advisory by default) | Yes (`invoke_subagent`, advisory by default) |
|
|
28
|
-
| **DET-06** (Bounded file-read clamp & overlap trim) | Yes (`updatedInput`) | Yes (`overwrite: { StartLine, EndLine }`) |
|
|
29
|
-
| **DET-07** (Bash stdout-flood & `Read`-clamp bypass guard) | Yes (`ask` by default) | Yes (`decision: ask \| deny`) |
|
|
30
|
-
| **DET-08** (Edit-time test-weakening & empty-catch guard) | Yes (`ask` by default) | Yes (`decision: ask \| deny`) |
|
|
31
|
-
| **DET-09** (Same-file rapid edit-thrash breaker) | Yes (`ask` after 5 edits/300s) | Yes (`decision: ask \| deny`) |
|
|
32
|
-
| **`PostToolUse` FTS5 log archive & MCP output replacement** | MCP
|
|
33
|
-
| **Turn-0 startup audit (`burnoff audit --startup`)** | Yes | Yes (`GEMINI.md`, `AGENTS.md`, `.agents/`) |
|
|
34
|
-
| **Local FinOps (`audit`, `pr-cost`, `ci-gate`)** | Yes | Yes (Gemini rate cards & `transcript.jsonl`) |
|
|
35
|
-
|
|
36
|
-
## Quickstart
|
|
37
|
-
|
|
38
|
-
Install Burnoff in your project, preview changes, wire hooks, and run your Turn-0 health & startup audit:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm i -D burnoff
|
|
42
|
-
npx burnoff init --dry-run
|
|
43
|
-
npx burnoff init # Claude Code (.claude/settings.local.json)
|
|
44
|
-
npx burnoff init --client antigravity # Google Antigravity CLI (.agents/hooks.json)
|
|
45
|
-
npx burnoff init --client antigravity --global # Global (~/.gemini/config/hooks.json)
|
|
46
|
-
npx burnoff init --client both # Wire both clients
|
|
47
|
-
npx burnoff audit --startup
|
|
48
|
-
npx burnoff doctor
|
|
49
|
-
npx burnoff doctor --gc # Prune >14d caches & rotate prior-month ledger
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Remove hooks cleanly at any time:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx burnoff uninstall
|
|
56
|
-
npx burnoff uninstall --client antigravity [--global]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Smoke Test (`PreToolUse` exit `2`)
|
|
60
|
-
|
|
61
|
-
Verify that the `PreToolUse` guard blocks secret reads before execution:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
echo '{"session_id":"smoke-1","tool_name":"Bash","tool_input":{"command":"cat .env;echo ok"}}' | node node_modules/burnoff/hooks/pre-tool-use.mjs; echo "exit=$?"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Expected output:
|
|
68
|
-
|
|
69
|
-
```text
|
|
70
|
-
[Burnoff DET-02 Secret & Credential Boundary] Access to sensitive credential path ".env" is blocked. (.env.example / .env.sample are permitted.)
|
|
71
|
-
exit=2
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Measured Hook Latency & `Read`-Clamp Savings
|
|
75
|
-
|
|
76
|
-
Measured directly on **Windows (`win32`, Node `v25.6.0`
|
|
77
|
-
|
|
78
|
-
| Hook / Path |
|
|
79
|
-
| :--- |
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
- `.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
| `burnoff
|
|
111
|
-
| `burnoff
|
|
112
|
-
| `burnoff
|
|
113
|
-
| `burnoff
|
|
114
|
-
| `burnoff
|
|
115
|
-
| `burnoff
|
|
116
|
-
| `burnoff
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
npx -y burnoff@1.4.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
##
|
|
200
|
-
|
|
201
|
-
- `
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
- `
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
# Burnoff
|
|
2
|
+
|
|
3
|
+
**Burnoff** — Deterministic circuit breakers, bounded file-read guards, and Turn-0 config linting for Claude Code (with experimental Google Antigravity CLI support).
|
|
4
|
+
|
|
5
|
+
Burnoff runs locally via `PreToolUse` and `PostToolUse` hooks to bound oversized file reads (`updatedInput`), stop runaway command failure loops, block destructive shell/git operations and credential reads, and statically lint Turn-0 repository config bloat (`CLAUDE.md`/`AGENTS.md`, `.mcp.json`, volatile prompt-prefix instructions `BO-CFG-11`). Zero runtime dependencies, MIT licensed, 100% local, and no proxy or daemon required.
|
|
6
|
+
|
|
7
|
+
## Why Burnoff?
|
|
8
|
+
|
|
9
|
+
- **Bounded File-Read Guards (`DET-06`):** Clamps oversized non-code reads (`250 lines / 16 KB`) via `updatedInput`, skips overlapping re-reads, and leaves active source files unclamped.
|
|
10
|
+
- **Deterministic Runaway Loop Breaker (`DET-04`):** Halts repeating tool or command failure loops after 3 consecutive failures using cross-process state locking, exempting read-only recovery steps and resetting cleanly on success or `git stash`.
|
|
11
|
+
- **Destructive Shell & Credential Guards (`DET-01` / `DET-02` / `DET-03`):** Blocks high-risk shell/git commands (`git push --force`, `--no-verify`, `rm -rf`) and sensitive credential/env paths (allowing `.env.example`/`.env.sample` templates), while routing reversible git resets and lockfile/workflow edits through interactive confirmation.
|
|
12
|
+
- **Turn-0 Startup Config Linter (`audit --startup`):** Audits `.mcp.json`, Claude Code settings, `.agents/mcp_config.json`, `GEMINI.md`/`AGENTS.md`/`.agents/rules/*.md`, volatile prompt-prefix instructions (`BO-CFG-11`), and tool bloat before a session starts.
|
|
13
|
+
- **Repo Policy & Local FinOps (`pr-cost` / `ci-gate`):** Correlates branch commits with local Claude Code and Google Antigravity CLI session transcripts, optionally reconciles against `.burnoff-ci/provider-usage.json`, and evaluates `.burnoff.yaml` thresholds via `ci-gate`.
|
|
14
|
+
|
|
15
|
+
## Requirements & Scope
|
|
16
|
+
|
|
17
|
+
- **Supported Agents:** **Claude Code** and **Google Antigravity CLI (experimental)**.
|
|
18
|
+
- **Runtime:** **Node.js `>=20.19.0`** (`Node.js >=22.13.0` recommended for built-in `node:sqlite` FTS5 indexing; older supported Node.js versions automatically run in local JSON fallback mode).
|
|
19
|
+
- **Dependencies:** **Zero runtime npm dependencies.**
|
|
20
|
+
|
|
21
|
+
### Client Capability Matrix
|
|
22
|
+
|
|
23
|
+
| Capability | Claude Code | Google Antigravity CLI (experimental) |
|
|
24
|
+
| :--- | :---: | :---: |
|
|
25
|
+
| **DET-01 / 02 / 03** (Shell, secret & protected-file guards) | Yes | Yes (`decision: deny \| ask`) |
|
|
26
|
+
| **DET-04** (Runaway loop breaker) | Yes (`PostToolUse` / `PostToolUseFailure`) | Yes (`PostToolUse.error`) |
|
|
27
|
+
| **DET-05** (Subagent fan-out & prompt-bloat guard) | Yes (`Task` / `Agent`, advisory by default) | Yes (`invoke_subagent`, advisory by default) |
|
|
28
|
+
| **DET-06** (Bounded file-read clamp & overlap trim) | Yes (`updatedInput`) | Yes (`overwrite: { StartLine, EndLine }`) |
|
|
29
|
+
| **DET-07** (Bash stdout-flood & `Read`-clamp bypass guard) | Yes (`ask` by default) | Yes (`decision: ask \| deny`) |
|
|
30
|
+
| **DET-08** (Edit-time test-weakening & empty-catch guard) | Yes (`ask` by default) | Yes (`decision: ask \| deny`) |
|
|
31
|
+
| **DET-09** (Same-file rapid edit-thrash breaker) | Yes (`ask` after 5 edits/300s) | Yes (`decision: ask \| deny`) |
|
|
32
|
+
| **`PostToolUse` FTS5 log archive & MCP output replacement** | MCP & built-in tool output replacement (default `replace` mode) + local FTS5 archive | **No** (`PostToolUse` returns `{}`) |
|
|
33
|
+
| **Turn-0 startup audit (`burnoff audit --startup`)** | Yes | Yes (`GEMINI.md`, `AGENTS.md`, `.agents/`) |
|
|
34
|
+
| **Local FinOps (`audit`, `pr-cost`, `ci-gate`)** | Yes | Yes (Gemini rate cards & `transcript.jsonl`) |
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
Install Burnoff in your project, preview changes, wire hooks, and run your Turn-0 health & startup audit:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm i -D burnoff
|
|
42
|
+
npx burnoff init --dry-run
|
|
43
|
+
npx burnoff init # Claude Code (.claude/settings.local.json)
|
|
44
|
+
npx burnoff init --client antigravity # Google Antigravity CLI (.agents/hooks.json)
|
|
45
|
+
npx burnoff init --client antigravity --global # Global (~/.gemini/config/hooks.json)
|
|
46
|
+
npx burnoff init --client both # Wire both clients
|
|
47
|
+
npx burnoff audit --startup
|
|
48
|
+
npx burnoff doctor
|
|
49
|
+
npx burnoff doctor --gc # Prune >14d caches & rotate prior-month ledger
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Remove hooks cleanly at any time:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx burnoff uninstall
|
|
56
|
+
npx burnoff uninstall --client antigravity [--global]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Smoke Test (`PreToolUse` exit `2`)
|
|
60
|
+
|
|
61
|
+
Verify that the `PreToolUse` guard blocks secret reads before execution:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
echo '{"session_id":"smoke-1","tool_name":"Bash","tool_input":{"command":"cat .env;echo ok"}}' | node node_modules/burnoff/hooks/pre-tool-use.mjs; echo "exit=$?"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Expected output:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
[Burnoff DET-02 Secret & Credential Boundary] Access to sensitive credential path ".env" is blocked. (.env.example / .env.sample are permitted.)
|
|
71
|
+
exit=2
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Measured Hook Latency & `Read`-Clamp Savings
|
|
75
|
+
|
|
76
|
+
Measured directly on **Windows (`win32 10.0.26300`, x64)**, CPU **AMD Ryzen 5 7535U with Radeon Graphics**, **Node `v25.6.0`** (cold-spawn CLI hook runs `n=7` after 1 warmup; reproduce locally with `node scripts/bench-hooks.mjs --runs 7`, or run `npm run test:bench` for warm daemon RPC benchmarks):
|
|
77
|
+
|
|
78
|
+
| Hook / Path | Median (`p50`) | `p95` | Min | Max |
|
|
79
|
+
| :--- | :---: | :---: | :---: | :---: |
|
|
80
|
+
| `PreToolUse` (Claude `Bash`) | `105.8 ms` | `108.3 ms` | `100.1 ms` | `108.3 ms` |
|
|
81
|
+
| `PreToolUse` (Claude `Read` bounded) | `90.9 ms` | `92.8 ms` | `87.2 ms` | `92.8 ms` |
|
|
82
|
+
| `PreToolUse` (Claude `Grep` Tier-1 fast allow) | `95.9 ms` | `130.5 ms` | `87.7 ms` | `130.5 ms` |
|
|
83
|
+
| `PreToolUse` (Antigravity `run_command`) | `109.6 ms` | `110.8 ms` | `107.5 ms` | `110.8 ms` |
|
|
84
|
+
| `PostToolUse` (Claude `Bash`) | `119.7 ms` | `138.5 ms` | `107.5 ms` | `138.5 ms` |
|
|
85
|
+
| `SessionStart` (Claude) | `90.7 ms` | `93.4 ms` | `88.8 ms` | `93.4 ms` |
|
|
86
|
+
|
|
87
|
+
Example measured `Read`-clamp (`DET-06`) run on an 800-line, `72,000`-byte (`~18,000` est. tokens) log file (`APP_SERVER.log`):
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+
|
|
91
|
+
- **Before clamp:** `800` lines / `72,000` bytes (`~18,000` est. tokens).
|
|
92
|
+
- **After `PreToolUse` `updatedInput` (`offset: 1, limit: 182`):** `182` lines / `16,379` bytes (`~4,095` est. tokens) — **`~13,905` est. tokens (`77.3%`) saved** in a single intercepted `Read` while respecting the `16 KB` (`16,384` B) ceiling.
|
|
93
|
+
|
|
94
|
+
## Local-Only Trust & Privacy
|
|
95
|
+
|
|
96
|
+
Burnoff runs 100% locally via hook subprocesses and local CLI commands:
|
|
97
|
+
|
|
98
|
+
- **Zero outbound network calls & zero proxy/MITM:** Your prompts, source code, and credentials never leave your machine.
|
|
99
|
+
- **Exact paths touched:**
|
|
100
|
+
- `~/.burnoff/` (or `$BURNOFF_HOME`): savings ledger, FTS5/JSON CLI log archive, and optional local warm daemon socket/pipe.
|
|
101
|
+
- `.claude/settings.local.json`: repo-local Claude Code hook wiring only (never modifies shared `.claude/settings.json`).
|
|
102
|
+
- `.claude/cache/` and `.claude/locks/`: session loop-breaker state, read-interval snapshots, lockfiles, and offloaded `>=4k`-token tool output artifacts (`.claude/cache/artifacts/burnoff_<sha256>.txt`, pruned via `npx burnoff doctor --gc`).
|
|
103
|
+
- `.agents/hooks.json` (project) or `~/.gemini/config/hooks.json` (global): written only when `--client antigravity` or `--client both` is passed.
|
|
104
|
+
- `.git/info/exclude`: privately ignores Burnoff's local files so `git status` stays spotless without touching `.gitignore`.
|
|
105
|
+
|
|
106
|
+
## CLI Commands
|
|
107
|
+
|
|
108
|
+
| Command | Purpose |
|
|
109
|
+
| :--- | :--- |
|
|
110
|
+
| `burnoff init [--dry-run]` | Wire `PreToolUse`, `PostToolUse`, and `PostToolUseFailure` hooks and update `.git/info/exclude`. |
|
|
111
|
+
| `burnoff uninstall [--dry-run]` | Remove Burnoff hooks and `.git/info/exclude` block. |
|
|
112
|
+
| `burnoff doctor [--gc] [--json]` | Inspect Node/SQLite FTS5, `.burnoff.yaml`, hook wiring, warm daemon, ledger, and prune >14d caches with `--gc`. |
|
|
113
|
+
| `burnoff audit --startup [--json]` | Run the Turn-0 startup config linter across `.mcp.json`, Claude Code settings, rule files, and `BO-MCP-10` proxy/meta-tool checks. |
|
|
114
|
+
| `burnoff audit [--session <file>] [--otel <path>] [--json]` | Parse local JSONL transcripts, Antigravity conversation DBs, and `gen_ai.usage.*` OTel spans (`TTFT`, `tok/s`, cost, cache hit %). |
|
|
115
|
+
| `burnoff pr-cost [--base main] [--provider-usage file.json]` | Correlate `git log <base>..HEAD` commits with session spend and output Markdown or `burnoff-pr-attribution/v1` JSON. |
|
|
116
|
+
| `burnoff export --since <iso\|duration> [--out file.json]` | Export clean `burnoff-pr-attribution/v1` spend & violation JSON for `ci-gate` from local transcripts. |
|
|
117
|
+
| `burnoff ci-gate --input pr-cost.json [--strict] [--github-annotations]` | Enforce `.burnoff.yaml` `ciBudgetGate` thresholds (`MAX_PR_COST_USD`, `MAX_PR_TOKENS`, `MIN_CACHE_HIT_PCT`, `MAX_WASTE_RATIO_PCT`, `MAX_RING0_VIOLATIONS`). |
|
|
118
|
+
| `burnoff team-digest [--days 7]` | Output a 5-line weekly summary of local spend, cache efficiency, top cost driver, and guard savings. |
|
|
119
|
+
| `burnoff search <turnId> [keyword]` | Search archived FTS5 CLI output without re-running expensive test or build commands. |
|
|
120
|
+
| `burnoff daemon <start\|stop\|status>` | Manage the workspace-scoped warm IPC daemon (`~/.burnoff/run/` or Windows named pipe). |
|
|
121
|
+
|
|
122
|
+
## For Teams: Repo Policy & GitHub Actions
|
|
123
|
+
|
|
124
|
+
Commit an optional `.burnoff.yaml` in your repository root so every developer shares the same deterministic guardrails, read bounds, and CI gate thresholds:
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
guards:
|
|
128
|
+
mode: guard
|
|
129
|
+
det04Threshold: 3
|
|
130
|
+
strictTestIntegrity: false
|
|
131
|
+
scopeLockEnabled: true
|
|
132
|
+
subagentFanoutEnabled: true
|
|
133
|
+
subagentFanoutAction: advisory
|
|
134
|
+
subagentMaxBurstCount: 4
|
|
135
|
+
subagentBurstWindowSec: 60
|
|
136
|
+
subagentMaxPromptChars: 8000
|
|
137
|
+
det07Enabled: true
|
|
138
|
+
det07Action: ask
|
|
139
|
+
det08Enabled: true
|
|
140
|
+
det08Action: ask
|
|
141
|
+
det09Enabled: true
|
|
142
|
+
det09Action: ask
|
|
143
|
+
det09MaxEditsPerFile: 5
|
|
144
|
+
det09WindowSec: 300
|
|
145
|
+
|
|
146
|
+
readClamp:
|
|
147
|
+
enabled: true
|
|
148
|
+
maxLines: 250
|
|
149
|
+
maxBytes: 16384
|
|
150
|
+
neverClampCodeOffCliff: true
|
|
151
|
+
|
|
152
|
+
postTool:
|
|
153
|
+
fts5Enabled: true
|
|
154
|
+
minBytesToCompress: 6144
|
|
155
|
+
retentionDays: 30
|
|
156
|
+
|
|
157
|
+
ciBudgetGate:
|
|
158
|
+
maxPrCostUsd: 15
|
|
159
|
+
maxPrTokens: 1500000
|
|
160
|
+
minCacheHitPct: 50
|
|
161
|
+
maxWasteRatioPct: 35
|
|
162
|
+
maxRing0Violations: 0
|
|
163
|
+
mode: enforce
|
|
164
|
+
failOnMissingTranscripts: false
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
See [`.github/workflows/burnoff-pr-gate.yml`](.github/workflows/burnoff-pr-gate.yml) for a SHA-pinned, least-privilege (`permissions: contents: read`) workflow built for `burnoff@1.4.1`:
|
|
168
|
+
|
|
169
|
+
- Runs `npx -y burnoff@1.4.1 pr-cost` (automatically passing `--provider-usage .burnoff-ci/provider-usage.json` when present) to produce `.burnoff-ci/pr-cost.json` and `.burnoff-ci/pr-cost.md`.
|
|
170
|
+
- Runs `npx -y burnoff@1.4.1 ci-gate --input .burnoff-ci/pr-cost.json --strict --github-annotations`.
|
|
171
|
+
- Appends the Markdown breakdown to `$GITHUB_STEP_SUMMARY` and posts non-fork PR summary comments.
|
|
172
|
+
|
|
173
|
+
> **Note on CI runners:** Ephemeral GitHub Actions runners do not have access to developers' local `~/.claude/projects/` transcripts. `failOnMissingTranscripts` automatically defaults to `true` when `CI` or `GITHUB_ACTIONS` is set (unless explicitly overridden in `.burnoff.yaml`), so upload `.burnoff-ci/provider-usage.json` or session transcripts before running `pr-cost` to enforce budgets cleanly.
|
|
174
|
+
|
|
175
|
+
## Turn-0 CI Config Linting (`audit --startup --ci`)
|
|
176
|
+
|
|
177
|
+
See [`.github/workflows/burnoff-startup-lint.yml`](.github/workflows/burnoff-startup-lint.yml) for a SHA-pinned, repo-local workflow that lints `CLAUDE.md`, `GEMINI.md`, `.claude/**`, `.agents/**`, `.mcp.json`, and `.burnoff.yaml` on PRs without touching runner home directories:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npx -y burnoff@1.4.1 audit --startup --ci --github-annotations --client auto
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Pass `--strict` to fail the workflow on warn-level lints as well as error-level secret/deprecated-model findings.
|
|
184
|
+
|
|
185
|
+
## Temporary `ask` Overrides (`allow-once` & `snooze`)
|
|
186
|
+
|
|
187
|
+
When an interactive `ask` prompt (`DET-01` soft discard, `DET-02` public-cert/arg check, `DET-03` lockfile/workflow edit, `DET-04` loop pause, `DET-07` stdout-flood guard, `DET-08` edit-integrity guard, or `DET-09` edit-thrash breaker) blocks an intentional action:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npx -y burnoff@1.4.1 allow-once DET-03 --scope deploy.yml
|
|
191
|
+
npx -y burnoff@1.4.1 allow-once DET-07 --scope "git log"
|
|
192
|
+
npx -y burnoff@1.4.1 snooze DET-04 --minutes 15
|
|
193
|
+
npx -y burnoff@1.4.1 allow-once --list
|
|
194
|
+
npx -y burnoff@1.4.1 allow-once --clear
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`allow-once` and `snooze` apply strictly to `ask` verdicts — Ring-0 `deny` / `exitCode: 2` hard blocks (`git push --force`, `.env`/credential reads, `strict`-mode blocks) are never bypassed.
|
|
198
|
+
|
|
199
|
+
## Claude Code Plugin & Status Line
|
|
200
|
+
|
|
201
|
+
Burnoff includes `.claude-plugin/plugin.json`, the `/burnoff` slash command (`commands/burnoff.md`), and a fail-silent terminal status-line script (`scripts/burnoff-statusline.mjs`). See [`docs/CLAUDE_CODE_PLUGIN.md`](docs/CLAUDE_CODE_PLUGIN.md) for setup and [`docs/DESIGN_PARTNER_INTAKE.md`](docs/DESIGN_PARTNER_INTAKE.md) for the private MIT design-partner intake form.
|
|
202
|
+
|
|
203
|
+
## Environment Variables
|
|
204
|
+
|
|
205
|
+
- `BURNOFF_HOME`: Override `~/.burnoff/` state directory.
|
|
206
|
+
- `BURNOFF_IPC_PATH`: Override daemon named pipe / Unix domain socket path.
|
|
207
|
+
- `BURNOFF_PRETOOL_FAIL_MODE`: Set to `closed` to fail-closed on internal hook faults (guard `exitCode: 2` blocks always fail-closed).
|
|
208
|
+
- `BURNOFF_POST_OUTPUT_MODE`: Override `PostToolUse` output mode (`auto`, `updatedToolOutput`, `additionalContext`).
|
|
209
|
+
- `BURNOFF_TIER1_ACTIVE`: Set to `1` to enable Tier-1 `Grep`/`Glob` fast-path pass-through.
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT — see [LICENSE](LICENSE).
|
package/bin/burnoff.mjs
CHANGED
package/commands/burnoff.md
CHANGED
|
@@ -3,7 +3,7 @@ description: Run Burnoff diagnostics, Turn-0 startup audits, ask-gate overrides,
|
|
|
3
3
|
argument-hint: "[doctor|audit|startup|allow-once <DET-xx>|snooze <DET-xx>|pr-cost|team-digest|init]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Run Burnoff (`npx -y burnoff@1.4.
|
|
6
|
+
Run Burnoff (`npx -y burnoff@1.4.1` or local `node bin/burnoff.mjs` when developing in the Burnoff repo) according to `$ARGUMENTS`:
|
|
7
7
|
|
|
8
8
|
- Empty arguments: run `burnoff doctor` and `burnoff team-digest --days 7` and summarize findings clearly.
|
|
9
9
|
- `doctor`: run `burnoff doctor` to verify Node/SQLite FTS5, hooks, and warm daemon health.
|
|
@@ -7,7 +7,7 @@ Burnoff ships a lightweight Claude Code plugin manifest (`.claude-plugin/plugin.
|
|
|
7
7
|
Run the CLI installer in your repository (or pass `--global` for user-wide defaults):
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx -y burnoff@1.4.
|
|
10
|
+
npx -y burnoff@1.4.1 init --client claude
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Why hooks are installed via `burnoff init` instead of a static hook file:
|
|
@@ -16,7 +16,7 @@ Why hooks are installed via `burnoff init` instead of a static hook file:
|
|
|
16
16
|
- Verify installation anytime with:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npx -y burnoff@1.4.
|
|
19
|
+
npx -y burnoff@1.4.1 doctor
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## 2. Enable `/burnoff` Slash Command
|
|
@@ -58,10 +58,10 @@ burnoff | saved: 14.2k tok ($0.04) | guards: 2 | ctx: 38%
|
|
|
58
58
|
When interactive `ask` gates pause an intentional edit or command (`DET-01`, `DET-02`, `DET-03`, or `DET-04`), grant a scoped single-use or timed snooze from your terminal:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
npx -y burnoff@1.4.
|
|
62
|
-
npx -y burnoff@1.4.
|
|
63
|
-
npx -y burnoff@1.4.
|
|
64
|
-
npx -y burnoff@1.4.
|
|
61
|
+
npx -y burnoff@1.4.1 allow-once DET-03 --scope deploy.yml
|
|
62
|
+
npx -y burnoff@1.4.1 snooze DET-04 --minutes 15
|
|
63
|
+
npx -y burnoff@1.4.1 allow-once --list
|
|
64
|
+
npx -y burnoff@1.4.1 allow-once --clear
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Security invariant: `allow-once` and `snooze` apply **only** to `ask` decisions. Ring-0 `deny` / `exitCode: 2` hard blocks (`git push --force`, `.env`/credential reads, strict-mode blocks) are never bypassed.
|
|
@@ -30,9 +30,9 @@ Burnoff (`MIT`, zero runtime dependencies, 100% local execution) is onboarding a
|
|
|
30
30
|
Run inside a representative repo and paste sanitized summary lines only:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
npx -y burnoff@1.4.
|
|
34
|
-
npx -y burnoff@1.4.
|
|
35
|
-
npx -y burnoff@1.4.
|
|
33
|
+
npx -y burnoff@1.4.1 doctor
|
|
34
|
+
npx -y burnoff@1.4.1 audit --startup --ci
|
|
35
|
+
npx -y burnoff@1.4.1 team-digest --days 7
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
### 4. Security & Privacy Requirements
|