burnoff 1.4.1 → 2.1.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/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/burnoff-pr-gate.yml +5 -3
- package/.github/workflows/burnoff-startup-lint.yml +2 -2
- package/CHANGELOG.md +74 -0
- package/README.md +187 -213
- package/SECURITY.md +38 -0
- package/bin/burnoff.mjs +307 -32
- package/commands/burnoff.md +6 -4
- package/docs/CLAUDE_CODE_PLUGIN.md +29 -28
- package/docs/DESIGN_PARTNER_INTAKE.md +3 -3
- package/hooks/hook-io.mjs +216 -11
- package/hooks/hooks.json +44 -0
- package/hooks/post-tool-use.mjs +3 -1
- package/hooks/pre-tool-use.mjs +47 -8
- package/hooks/session-lifecycle.mjs +24 -3
- package/hooks/user-prompt-submit.mjs +98 -0
- package/package.json +6 -4
- package/scripts/bench-hooks.mjs +34 -3
- package/scripts/bench-savings.mjs +318 -0
- package/scripts/burnoff-statusline.mjs +138 -6
- package/src/ci/ci-gate.mjs +199 -13
- package/src/ci/pr-cost.mjs +417 -45
- package/src/ci/pr-summary.mjs +467 -0
- package/src/cli/audit.mjs +179 -28
- package/src/cli/doctor.mjs +32 -6
- package/src/cli/hook-health.mjs +9 -1
- package/src/cli/init.mjs +226 -39
- package/src/cli/preview.mjs +299 -0
- package/src/cli/startup-audit/formatter.mjs +248 -0
- package/src/cli/startup-audit/jsonc.mjs +601 -0
- package/src/cli/startup-audit/mcp-audit.mjs +735 -0
- package/src/cli/startup-audit/rules-hygiene.mjs +645 -0
- package/src/cli/startup-audit/telemetry-scan.mjs +975 -0
- package/src/cli/startup-audit.mjs +451 -2471
- package/src/clients/claude-code.mjs +41 -4
- package/src/config/catalog.json +295 -0
- package/src/config/effort.mjs +145 -0
- package/src/config/harness-quirks.mjs +340 -0
- package/src/config/loader.mjs +27 -2
- package/src/config/policy.mjs +81 -9
- package/src/config/pricing.mjs +247 -19
- package/src/config/semver.mjs +25 -0
- package/src/config/uncached-attribution.mjs +280 -41
- package/src/guards/compaction-baton.mjs +248 -0
- package/src/guards/loop-breaker.mjs +328 -47
- package/src/guards/model-switch-hook.mjs +126 -0
- package/src/guards/phase5-detectors.mjs +275 -21
- package/src/guards/post-tool-engine.mjs +333 -11
- package/src/guards/pre-tool-engine.mjs +607 -45
- package/src/guards/prefix-guard.mjs +609 -0
- package/src/guards/prompt-guard.mjs +309 -0
- package/src/guards/read-clamp.mjs +192 -8
- package/src/guards/session-hook.mjs +149 -7
- package/src/guards/shell-guard.mjs +56 -5
- package/src/guards/snooze.mjs +169 -5
- package/src/ipc/daemon.mjs +76 -0
- package/src/ipc/fast-client.mjs +165 -4
- package/src/ipc/protocol.mjs +16 -3
- package/src/storage/antigravity-parser.mjs +16 -2
- package/src/storage/file-lock.mjs +16 -3
- package/src/storage/jsonl-parser.mjs +133 -22
- package/src/storage/telemetry-metrics.mjs +254 -4
|
@@ -23,6 +23,8 @@ jobs:
|
|
|
23
23
|
with:
|
|
24
24
|
node-version: '22'
|
|
25
25
|
|
|
26
|
+
# If .burnoff-ci/pr-summary.json (exported locally via `burnoff pr-cost --write-summary`)
|
|
27
|
+
# is committed in the PR branch, `pr-cost` automatically hydrates and verifies it with zero secrets.
|
|
26
28
|
- name: Compute PR Cost Attribution
|
|
27
29
|
run: |
|
|
28
30
|
mkdir -p .burnoff-ci
|
|
@@ -30,13 +32,13 @@ jobs:
|
|
|
30
32
|
if [ -s .burnoff-ci/provider-usage.json ]; then
|
|
31
33
|
USAGE_FLAG="--provider-usage .burnoff-ci/provider-usage.json"
|
|
32
34
|
fi
|
|
33
|
-
npx -y burnoff@1.
|
|
34
|
-
npx -y burnoff@1.
|
|
35
|
+
npx -y burnoff@2.1.0 pr-cost --base "origin/${{ github.base_ref }}" $USAGE_FLAG --json --out .burnoff-ci/pr-cost.json
|
|
36
|
+
npx -y burnoff@2.1.0 pr-cost --base "origin/${{ github.base_ref }}" $USAGE_FLAG --markdown --out .burnoff-ci/pr-cost.md
|
|
35
37
|
|
|
36
38
|
- name: Enforce CI Token-Budget Gate
|
|
37
39
|
id: gate
|
|
38
40
|
run: |
|
|
39
|
-
npx -y burnoff@1.
|
|
41
|
+
npx -y burnoff@2.1.0 ci-gate --input .burnoff-ci/pr-cost.json --strict --github-annotations --out .burnoff-ci/ci-gate.md
|
|
40
42
|
cat .burnoff-ci/pr-cost.md >> "$GITHUB_STEP_SUMMARY"
|
|
41
43
|
cat .burnoff-ci/ci-gate.md >> "$GITHUB_STEP_SUMMARY"
|
|
42
44
|
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.
|
|
30
|
+
# External consumers copying this workflow can use npx -y burnoff@2.1.0 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.
|
|
35
|
+
npx -y burnoff@2.1.0 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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.1.0] - 2026-11-28
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Zero-Secret PR Usage Summary Export & Ephemeral CI Runner Hydration (`burnoff-pr-summary/v1`)** (`src/ci/pr-summary.mjs`, `src/ci/pr-cost.mjs`, `src/ci/ci-gate.mjs`, `bin/burnoff.mjs`, `test/pr-summary-sync.test.mjs`):
|
|
7
|
+
- Added `burnoff pr-cost --write-summary [file]` (default `.burnoff-ci/pr-summary.json`) to export a zero-prompt, zero-secret PR usage summary with allowlisted metrics, stripped OS home paths, `.claude/settings.local.json` and `author`/`sessionId` removal, credential redaction via `redactSecretsPure`, and a canonical SHA-256 `integrity.digest`.
|
|
8
|
+
- Wired automatic `.burnoff-ci/pr-summary.json` hydration into `buildPrCostAttribution` when ephemeral CI runners have zero local transcripts, alongside explicit `--summary <file>` on `pr-cost` and `ci-gate`, `burnoff-pr-summary/v1` verification inside `ci-gate --input`, fail-closed `SUMMARY_INTEGRITY_MISMATCH` tamper rejection, `STALE_PR_SUMMARY` `HEAD`-drift notice, `wasteRatioBasis` override support, and `--provider-usage` reconciliation on hydrated summaries.
|
|
9
|
+
|
|
10
|
+
## [2.0.0] - 2026-11-28
|
|
11
|
+
|
|
12
|
+
### Summary
|
|
13
|
+
Major `v2.0.0` release delivering zero-commitment 3-second onboarding (`npx burnoff`), sub-15 ms auto-managed warm daemon IPC, quiet Friction defaults with `pause`/`bypass` escape hatches, cross-OS `npm pack` E2E verification, Turn-0 startup linting, modularized audit architecture, and automated PR cost gates.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **Zero-Commitment 3-Second Preview (`npx burnoff` / `burnoff preview`)** (`src/cli/preview.mjs`, `src/storage/jsonl-parser.mjs`, `bin/burnoff.mjs`): running bare `npx burnoff` scans recent local Claude Code and Antigravity sessions strictly read-only (zero disk writes, cache writes bypassed via `readOnly: true`) and prints a <=72-col savings & top-waste receipt in under 3 seconds.
|
|
17
|
+
- **Auto-Managed Warm IPC Daemon (`<15 ms` hot path)** (`src/ipc/daemon.mjs`, `src/ipc/fast-client.mjs`, `hooks/session-lifecycle.mjs`, `src/guards/loop-breaker.mjs`): `SessionStart` lazily spawns a workspace-scoped background daemon (`15m` idle auto-reap, `30s` lock cooldown, `BURNOFF_NO_AUTO_DAEMON=1` opt-out) and removes redundant `fsyncSync` on ephemeral read/breaker snapshots (`skipFsync: true`).
|
|
18
|
+
- **Workspace Escape Hatches (`burnoff pause` & `burnoff bypass`)** (`src/guards/snooze.mjs`, `src/guards/pre-tool-engine.mjs`, `bin/burnoff.mjs`): `burnoff pause [15m|1h|status|off]` soft-pauses interactive `ask` gates, read clamps, and non-Ring-0 advisories while keeping Ring-0 `deny` / `exitCode: 2` hard blocks (`DET-01`, `DET-02`, `DET-20`) enforced; `burnoff bypass [--grant <substr> | -- <cmd...>]` grants 1-use `DET-07` overrides or runs commands directly outside hook clamps.
|
|
19
|
+
- **Auto-Wired Status Line & PAUSED / Compact USD Display** (`scripts/burnoff-statusline.mjs`, `src/cli/init.mjs`): `burnoff init` automatically wires `statusLine` when no custom user footer exists (`--no-statusline` to skip; cleanly removed on `uninstall`); displays `7d saved: X tok`, suppresses `<$0.10` USD clutter, and appends `PAUSED Nm` during workspace pause windows.
|
|
20
|
+
- **Modularized Turn-0 Auditor & Security Disclosure** (`src/cli/startup-audit.mjs`, `src/cli/startup-audit/*.mjs`, `SECURITY.md`): split `startup-audit` into 5 focused acyclic submodules (`jsonc.mjs`, `rules-hygiene.mjs`, `mcp-audit.mjs`, `telemetry-scan.mjs`, `formatter.mjs`) preserving 100% public exports, and added `SECURITY.md` documenting local-only execution, secret/path scrubbing, and fail-closed Ring-0 guarantees.
|
|
21
|
+
- **Cross-OS `npm pack` E2E & Pricing Regression Locks** (`test/e2e-pack-npx.test.mjs`, `.github/workflows/ci.yml`, `test/prelaunch-bugfixes.test.mjs`): added `macos-latest` to the CI matrix and packed-tarball E2E tests covering Windows/macOS/Linux space-containing paths, real hook execution, global isolation, and zero `TODO(verify)` pricing entries.
|
|
22
|
+
- **Reproducible Benchmarks & Launch Kit** (`scripts/bench-savings.mjs`, `docs/BENCHMARKS.md`, `SPONSORS.md`, `.github/FUNDING.yml`): added reproducible 4-workload savings & latency benchmarks alongside MIT Core pledge and sponsorship docs.
|
|
23
|
+
- **Phase 11 (`omitClaudeMd`, trigger-hijack, GPT-6.x pricing, `#1890` split, `BO-CMP-01` laundering & `DET-01` worktree/`trash`)**:
|
|
24
|
+
- **Subagent `omitClaudeMd: true` coaching (`BO-CFG-18`)** (`src/cli/startup-audit.mjs`): `scanClaudeCustomAgentSpecs` parses `omitClaudeMd` and role hints, emitting an `info` advisory when lookup/search/log-reading custom subagents spawn on Claude Code `>= v2.1.271` with large root `CLAUDE.md` (`>= 1,500` tokens), excluding `Explore`/`Plan` and code reviewers/writers.
|
|
25
|
+
- **`SKILL.md` frontmatter trigger-hijack detection (`BO-CFG-16`)** (`src/cli/startup-audit.mjs`): warns on global over-trigger routing imperatives (`MUST be used BEFORE`, `for ANY request`, `ALWAYS invoke ... first`, `BEFORE web search / model memory / any other skill`) without matching generic `overrides the default ...` phrases.
|
|
26
|
+
- **OpenAI GPT-6.x pricing cards (`gpt-6.1-terra`, `gpt-6-astra`, `gpt-6-luna`)** (`src/config/pricing.mjs`, `src/config/catalog.json`): added rate cards, aliases, family detection, and 272K long-context cliff schedules alongside Antigravity `1.5.18` `#1890` support.
|
|
27
|
+
- **Antigravity `#1890` rule split (`BO-CFG-19`)** (`src/cli/startup-audit.mjs`, `test/startup-audit-rank2.test.mjs`): separated `#1890` (`acp --agent` 4x quota multiplier) from `BO-CFG-12` (Always/NEVER contradictions).
|
|
28
|
+
- **Compaction-laundering hardening (`BO-CMP-01`)** (`src/guards/compaction-baton.mjs`): `sanitizeBatonText` neutralizes forged `[User]:`/`[Assistant]:`/`[System]:` markers and approval-laundering phrases across baton inputs/rendering and adds an explicit untrusted-state provenance line.
|
|
29
|
+
- **Worktree force-remove & protected `trash` guards (`DET-01`)** (`src/guards/shell-guard.mjs`): guards `git worktree remove --force` / `-f` (`GIT_WORKTREE_FORCE_REMOVE`) and `trash` targeting `.git` or `.claude/worktrees` (`TRASH_PROTECTED_GIT_TARGET`).
|
|
30
|
+
- **Matcher-level hook parity enforcement** (`test/brand-and-surface.test.mjs`, `test/phase9-brief-updates.test.mjs`): extends hook manifest parity checks beyond event names to verify per-event `matcher` equality against `buildClaudeHooksConfig()` (ensuring `PostToolUse` / `PostToolUseFailure` exclude `Grep|Glob`).
|
|
31
|
+
- **`claude-opus-4-5` deprecation tracking & pricing card** (`src/cli/startup-audit.mjs`, `src/config/pricing.mjs`): adds `claude-opus-4-5` / `claude-opus-4-5-20251101` to `RETIRED_MODELS_SPEC` (deprecated Nov 23, 2026; retiring Jan 22, 2027 -> `claude-opus-5-5`) and explicit `$5/$0.50/$25` rate card/aliases with `minCacheableTokens: 4096`.
|
|
32
|
+
- **Gemini `thoughtsTokenCount` parser support** (`src/storage/jsonl-parser.mjs`, `src/storage/antigravity-parser.mjs`): reads `thoughtsTokenCount`, `thoughts_token_count`, and `usageMetadata.thoughtsTokenCount` as reported thinking tokens for `BO-THK-01` and audit attribution.
|
|
33
|
+
- **`BO-CFG-16` lean `SKILL.md` lint & `< 2.1.331` upgrade note (`BO-CFG-17`)** (`src/cli/startup-audit.mjs`): checks `.claude/skills/` and `.agents/skills/` `SKILL.md` frontmatter for missing `name`/`description` or descriptions exceeding `1,024` chars, notes `.agents/skills`-only placement (`info`), and adds a consolidated `< 2.1.331` `--resume` cache/compaction upgrade notice (`info`, merged into `BO-CFG-13` when `.claude/worktrees` is present).
|
|
34
|
+
- **`BO-CMP-01` recent command ring buffer** (`src/guards/loop-breaker.mjs`, `src/guards/compaction-baton.mjs`, `src/guards/session-hook.mjs`, `src/config/policy.mjs`): persists up to 8 secret-scrubbed `[passed]` / `[failed]` shell commands through `PreCompact` -> post-compaction `SessionStart` (`compactionBatonMaxBytes` raised `2048` -> `3584`, context cap `1500` -> `2400`).
|
|
35
|
+
- **Claude Code `v2.1.332` `PreSkillShellCommand` & worktree parity** (`hooks/hooks.json`, `src/cli/init.mjs`, `src/clients/claude-code.mjs`, `src/guards/pre-tool-engine.mjs`, `src/cli/startup-audit.mjs`): routes inline skill shell commands through Burnoff's shell/secret guards using the non-interactive exit-2 / empty-stdout contract, and adds version-gated `< 2.1.332` `.claude/worktrees` duplicate-`CLAUDE.md` lint `BO-CFG-13`.
|
|
36
|
+
- **OpenAI `GPT-6.2 Astra` & `GPT-6.2 Sol` rate cards** (`src/config/catalog.json`, `src/config/pricing.mjs`): added standard (`<=272k`) and above-cliff (`>272k`) rate schedules, `0.05x` cached read weight, and `openai/` / hyphenated aliases.
|
|
37
|
+
- **`DET-08` `ASSERTION_COUNT_DROP` & `BO-CFG-14`/`15` hardening** (`src/guards/phase5-detectors.mjs`, `src/cli/startup-audit.mjs`, `src/config/policy.mjs`): emits an advisory notice when a test edit halves assertion count (`>=4 -> <=50%`) without escalating non-test files, and adds `info`-only `cleanupPeriodDays` (`BO-CFG-14`) and `typescript-lsp` plugin + edit-hook validation (`BO-CFG-15`) startup notes.
|
|
38
|
+
- **Per-model `minCacheableTokens` coverage** (`src/config/catalog.json`, `src/config/pricing.mjs`): populated documented Anthropic minimum cacheable prompt lengths (512 / 1024 / 2048 / 4096) with `minCacheableSourceUrl` and `minCacheableCheckedOn: '2026-11-28'` metadata across catalog entries and rate cards, and wired `resolveModelRateCard` to read catalog thresholds (keeping 4096 as the unmapped default).
|
|
39
|
+
- **`likely_lookback_miss` uncached attribution sub-bucket** (`src/storage/jsonl-parser.mjs`, `src/config/uncached-attribution.mjs`, `src/cli/audit.mjs`): tracks `appendedPositionsSincePrevCall` on main-thread API calls (deduped by `message.id`, collapsing consecutive `tool_use` and `tool_result` runs to 1 position each) and surfaces heuristic `likely_lookback_miss` resets (`>=20` positions on Anthropic models, still inside `actionableWasteTokens`) in `formatAuditReport`.
|
|
40
|
+
- **Mid-session subagent definition guards** (`src/guards/pre-tool-engine.mjs`, `src/cli/startup-audit.mjs`): added `BO-MOD-02` `SUBAGENT_DEFINITION_EDIT` advisory when editing `.claude/agents/*.md` or `~/.claude/agents/*.md` after turn 1, and extended `BO-CFG-11` to flag `SessionStart` hook commands that write into `.claude/agents/`.
|
|
41
|
+
- **`PreModelSwitch` / `PostModelSwitch` hooks**: routed through `hooks/session-lifecycle.mjs` to `src/guards/model-switch-hook.mjs`. Pre warns on warm-prefix model switches and A->B->A ping-pong; `guards.modelSwitchAction: 'deny'` (default `'allow'`) blocks via exit 2. Post is observational and records `lastModel` / `recentModels`. Read snapshots are not cleared on a model switch. New policy keys: `guards.modelSwitchAction`, `guards.modelSwitchWarmMinTokens` (default `10000`).
|
|
42
|
+
- **`resolveEffortLevel` / `effortChangePreservesCache`** (`src/config/effort.mjs`): shared effort normalization (object `{ level }` payloads, `$CLAUDE_EFFORT` fallback on `UserPromptSubmit`, prior-state and transcript fallback) and a model/provider cache-safety check (5.5-generation and Fable 5.1+ on first-party API; Bedrock/Vertex/Foundry excluded).
|
|
43
|
+
- **`resolveHostShellOutputCap`**: honors `bashOutputMaxChars` (clamped to 4,000-128,000; precedence local -> project -> user settings) before `BASH_MAX_OUTPUT_LENGTH`.
|
|
44
|
+
- **`isFetchLikeTool`**: `WebFetch` budgeting now also covers raw MCP fetch/scrape/get_page/read_url tools.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- **Quiet Friction Defaults (`DET-09` & Prompt Coaching)** (`src/config/policy.mjs`, `src/guards/phase5-detectors.mjs`, `src/guards/prompt-guard.mjs`): lowered `guards.det09Action` to `'advisory'`, set `guards.promptCoachEnabled` to `false` by default (gating `DET-13`/`14`/`17` prompt coaching cleanly as opt-in), and moved `guards.det13Enabled`/`det14Enabled`/`det17Enabled` to tri-state `null` auto-inheritance while preserving explicit overrides.
|
|
48
|
+
- `BO-MOD-01`, `BO-MOD-02` and `BO-THK-01` guidance is model/provider-aware; effort-only switches on cache-safe models no longer raise `BO-MOD-02`.
|
|
49
|
+
- The root `CLAUDE.md` / `.mcp.json` mid-session edit message no longer claims the cache is rebuilt; edits stay inert until `/clear`, `/compact`, or restart.
|
|
50
|
+
- `postTool.webFetchMaxTokens` default raised `1800` -> `4000`; the digest keeps heading outlines plus code-fence signatures.
|
|
51
|
+
- Read-dedup entries now also expire after a 15-turn gap (`DEFAULT_READ_INTERVAL_MAX_TURN_GAP`) in addition to the existing 30-minute age limit.
|
|
52
|
+
- `DET-17` is unchanged: `ask` only fires for vague refactor prompts with no discovery calls when prompt coaching is enabled; otherwise advisory.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **Thinking-token fallback estimation** (`src/storage/jsonl-parser.mjs`, `src/guards/prefix-guard.mjs`, `src/config/loader.mjs`, `src/cli/audit.mjs`): read provider-reported `usage.output_tokens_details.thinking_tokens` / `reasoning_tokens` when present, and replaced the `thinkingText.length / 4` fallback (which undercounted or zeroed out summarized/omitted reasoning blocks) with a labeled `output_tokens - visible_output` upper-bound estimate (`thinkingTokensEstimated: true`, `thinkingTokensSource: 'output_minus_visible_upper_bound'`) surfaced in `BO-THK-01` and `formatAuditReport`.
|
|
56
|
+
- Claude Code's `{ level: "max" }` effort payload no longer coerces to `"[object Object]"`, which had silently disabled `BO-MOD-01` and `BO-MOD-02`.
|
|
57
|
+
- `isHostTruncatedShellOutput` no longer skips compression of complete 30K-128K inline Bash output on modern hosts. The legacy length-based skip applies only when `claudeCodeVersion` is below `2.1.2` (`LEGACY_INLINE_TRUNC_CUTOFF`) or `legacyInlineTruncation: true`.
|
|
58
|
+
|
|
59
|
+
### Breaking Changes (v2.0.0)
|
|
60
|
+
- **CI Budget Gate (`ciBudgetGate.wasteRatioBasis`)**: `ciBudgetGate` and `burnoff pr-cost` now default to `wasteRatioBasis: 'actionable'` instead of gross uncached waste. Heuristic upstream Gemini 4 eviction patterns (`<=60s`, `150-260s`, `701+/-25`, `prefix_shard_cut`) and the `2,050`-token append floor are labeled as `"attributed to upstream"` and excluded from `actionableWasteTokens`, while `grossWasteTokens` and `actionableWasteTokens` are reported side-by-side in PR and CI gate Markdown. Pure Claude Code sessions remain identical (`grossWasteTokens === actionableWasteTokens`). Set `ciBudgetGate.wasteRatioBasis: gross` in `.burnoff.yaml` (or pass `--waste-basis gross`) to restore the legacy gross waste ratio threshold.
|
|
61
|
+
|
|
62
|
+
### Earlier [2.0.0] Additions & Fixes (2026-11-27)
|
|
63
|
+
- **Source-Backed Platform-Scoped Lifecycles (`BO-CFG-09`)**: Added per-harness lifecycle specs with `sourceUrl` and `checkedOn` metadata (`antigravity.sunsetUtc: '2026-11-30T00:00:00Z'`; Anthropic API `claude-opus-4-6` and `claude-sonnet-4-6` active `info` advisories with `notSoonerThanUtc: '2027-02-05T00:00:00Z'`).
|
|
64
|
+
- **Antigravity Turn-0 Parity**: Added `BO-MCP-07` (`#1530` ACP `--stdio` eager >16KB MCP manifest & skill eviction check), `BO-CFG-12` (`#1890` Antigravity `1.5.17` `acp --agent` 4.0x est. quota alert), and Antigravity `BO-CFG-01`, `BO-MCP-05`, and `BO-MCP-06` checks.
|
|
65
|
+
- **Safe `<uuid>.db` + `transcript.jsonl` Merge**: Added `validateAntigravityDbCounters` and `mergeAntigravitySessionSources` with warm-cache sanity guardrails (`SQLITE_SANITY_FALLBACK`) and `counterSource` provenance wired into `audit` and `pr-cost`.
|
|
66
|
+
- **Rank 5 Harness Quirks & Statusline (`BO-HAB-01..06`)**: Added `src/config/harness-quirks.mjs` covering `THINKING_LEVEL_XHIGH` HTTP 400, `1.5.18` Orchestrator misroutes, `/btw` (`trajectory_type = 22`) and `#1646` loops, `0x3e800` `256K` clamp vs flat 1M pricing, `#1442` hook `/compact` fallacy, and `#1876` bloated `GEMINI.md` 429s; added normalized `hit: X%` and Antigravity Gemini 4 `clamp: Xk/256k` indicators to `scripts/burnoff-statusline.mjs`.
|
|
67
|
+
- **Optional Warn-Only Quota Gate (`maxPrQuotaUnits` / `quotaGateMode`)**: Added `ciBudgetGate.maxPrQuotaUnits` (default `null`) and `quotaGateMode` (`'warn'` default, `'fail'` opt-in) with `"est."` weight disclosure (`Q-units` reported strictly separate from USD) and `MISSING_TRANSCRIPTS` protection so `0` usage never passes silently.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- **Model Retirement False Errors**: Removed incorrect `2026-11-18` sunset dates and Claude Code mis-tagging in `BO-CFG-09`.
|
|
71
|
+
- **Antigravity IDE Lazy-MCP False Positives (`BO-MCP-10`)**: Scoped eager schema warnings to explicit `eager: true`, `loading: 'eager'`, or ACP `--stdio` mode.
|
|
72
|
+
- **Historical Dec 1 Pricing (`audit.mjs`)**: Passed `eventTimestampUtc: step.createdAt` so pre-Dec-1 Carbon/Argon turns remain valued at `$2/$10` after `2026-12-01`, and synced `src/config/catalog.json`.
|
|
73
|
+
- **SQLite `genMetadataIdx` Misjoin & `4x` Duplication (`telemetry-metrics.mjs`)**: Removed the `Number(row.idx)` fallback and deduplicated tool sub-steps (`step_type = 132`) from primary model generations (`step_type = 15`).
|
|
74
|
+
- **Claude 5.5 `#99624` Attribution**: Exempted `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` sessions and aligned `pr-cost` with `attributeUncachedTokens()` (`HIGH_UPSTREAM_EXCLUSION_SHARE` notice when `>50%` of uncached input is excluded).
|
package/README.md
CHANGED
|
@@ -1,213 +1,187 @@
|
|
|
1
|
-
# Burnoff
|
|
2
|
-
|
|
3
|
-
**Burnoff** —
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
npm
|
|
42
|
-
npx burnoff
|
|
43
|
-
npx burnoff
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
| `PreToolUse` (Claude `
|
|
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
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
| `
|
|
120
|
-
| `burnoff
|
|
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
|
-
```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).
|
|
1
|
+
# Burnoff
|
|
2
|
+
|
|
3
|
+
**Burnoff** — The local safety and token firewall for Claude Code and Google Antigravity. Zero dependencies, 100% MIT.
|
|
4
|
+
|
|
5
|
+
Deterministic circuit breakers, bounded file-read guards, and CI spend gates that stop runaway test loops, oversized log reads, secret leaks, and Turn-0 context bloat before they hit your API bill.
|
|
6
|
+
|
|
7
|
+
[](https://github.com/Gizzant/burnoff/actions/workflows/ci.yml)
|
|
8
|
+
[](https://www.npmjs.com/package/burnoff)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](package.json)
|
|
11
|
+
[](https://socket.dev/npm/package/burnoff)
|
|
12
|
+
|
|
13
|
+
Burnoff intercepts tool calls locally via `PreToolUse` and `PostToolUse` hooks with a warm local IPC daemon (`p50 8.0 ms, p95 12.1 ms`), keeping oversized reads bounded (`updatedInput`), breaking 3x failing command loops, and blocking destructive shell commands and `.env` credential reads before execution. It also audits Turn-0 config bloat (`CLAUDE.md`, `GEMINI.md`, `.mcp.json`) and reconciles branch spend in GitHub Actions without proxies, MITM, or outbound telemetry.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
*One intercepted `Read` on an 800-line log file (`APP_SERVER.log`): clamped from `800` lines / `72,000` B (`~18,000` est. tok) to `182` lines / `16,379` B (`~4,095` est. tok) — `~13,905` tokens (`77.3%`) saved cleanly.*
|
|
18
|
+
|
|
19
|
+
## Zero-Commitment Quickstart (`< 30 Seconds`)
|
|
20
|
+
|
|
21
|
+
Preview your last 7 days of local Claude Code & Antigravity transcripts without installing anything or writing a single file:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx burnoff
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Install deterministic hooks + auto-wired status line (no `npm i -D` required):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx burnoff init # Claude Code (.claude/settings.local.json + statusLine)
|
|
31
|
+
npx burnoff init --no-statusline # Hooks only (keep your existing footer)
|
|
32
|
+
npx burnoff init --client antigravity # Google Antigravity CLI (experimental, .agents/hooks.json)
|
|
33
|
+
npx burnoff doctor # Verify Node, SQLite FTS5, hooks, warm daemon & ledger
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Escape hatches when you need full speed on an intentional task:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx burnoff pause 15m # Soft-pause ask gates & read clamps (Ring-0 blocks stay active!)
|
|
40
|
+
npx burnoff pause off # Resume normal guardrails immediately
|
|
41
|
+
npx burnoff bypass -- npm test # Run one command directly outside read clamps
|
|
42
|
+
npx burnoff bypass --grant huge.log # Grant a single-use DET-07 override
|
|
43
|
+
npx burnoff uninstall # Cleanly removes hooks, statusLine & git exclude entries
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Smoke Test (`PreToolUse` Exit `2` Hard Block)
|
|
47
|
+
|
|
48
|
+
<details>
|
|
49
|
+
<summary>Bash (macOS / Linux / Git Bash) and Windows PowerShell smoke tests</summary>
|
|
50
|
+
|
|
51
|
+
**Bash:**
|
|
52
|
+
```bash
|
|
53
|
+
echo '{"session_id":"smoke-1","tool_name":"Bash","tool_input":{"command":"cat .env;echo ok"}}' | npx --no-install burnoff hook pre; echo "exit=$?"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Windows PowerShell:**
|
|
57
|
+
```powershell
|
|
58
|
+
'{"session_id":"smoke-1","tool_name":"Bash","tool_input":{"command":"cat .env;echo ok"}}' | node "$env:APPDATA\npm\node_modules\burnoff\hooks\pre-tool-use.mjs"; "exit=$LASTEXITCODE"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Expected:
|
|
62
|
+
```text
|
|
63
|
+
[Burnoff DET-02 Secret & Credential Boundary] Access to sensitive credential path ".env" is blocked. (.env.example / .env.sample are permitted.)
|
|
64
|
+
exit=2
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
</details>
|
|
68
|
+
|
|
69
|
+
## Measured Latency & Workload Savings
|
|
70
|
+
|
|
71
|
+
Burnoff auto-spawns a workspace-scoped local IPC daemon (`~/.burnoff/run/` on POSIX, Windows named pipe) on `SessionStart` with a 15-minute idle timeout (`BURNOFF_NO_AUTO_DAEMON=1` disables). Measured on **Windows (`win32 10.0.26300`, x64, Node `v25.6.0`)** — see [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) to reproduce locally:
|
|
72
|
+
|
|
73
|
+
| Path | Mode | Median (`p50`) | `p95` | Notes |
|
|
74
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
75
|
+
| `PreToolUse` (`DET-01`..`20` IPC) | **Warm auto-daemon** | **`8.0 ms`** | **`12.1 ms`** | Auto-managed IPC (`node scripts/bench-hooks.mjs --runs 5`) |
|
|
76
|
+
| `PreToolUse` (`Grep` Tier-1 fast allow) | Cold CLI subprocess | `95.7 ms` | `103.3 ms` | Regex bypass without full engine load |
|
|
77
|
+
| `SessionStart` (Claude) | Cold CLI subprocess | `121.8 ms` | `124.5 ms` | Spawns warm daemon asynchronously |
|
|
78
|
+
| `PreToolUse` (Claude `Bash`) | Cold CLI subprocess | `128.8 ms` | `140.0 ms` | Fallback when daemon stopped |
|
|
79
|
+
| `PostToolUse` (Claude `Bash`) | Cold CLI subprocess | `143.5 ms` | `159.2 ms` | Includes SQLite FTS5 archive |
|
|
80
|
+
| `PreToolUse` (Claude `Read` bounded) | Cold CLI subprocess | `146.6 ms` | `165.4 ms` | Bounded read firewall cold spawn |
|
|
81
|
+
|
|
82
|
+
Single-pass reproducible workload benchmark (`node scripts/bench-savings.mjs`, `claude-sonnet-5-5` ref rate): **`65,825` tokens saved** across `DET-06` log clamp (`14,625`), `DET-04` loop break + FTS5 offload (`38,400`), Turn-0 config audit (`12,800`), and `3/3` Ring-0 security blocks — `$0.1573` uncached / `$0.0355` at `0.27x` cache-read weight.
|
|
83
|
+
|
|
84
|
+
## How Burnoff Compares
|
|
85
|
+
|
|
86
|
+
| Feature | **Burnoff (`v2.1.0`)** | Cloud API Proxies | CLI Output Compressors (RTK, etc.) | Usage Viewers (`ccusage`) | Hand-Rolled Shell Hooks |
|
|
87
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
88
|
+
| **100% Local (Zero MITM / Zero Network)** | Yes | No (proxy server) | Yes | Yes | Yes |
|
|
89
|
+
| **Ring-0 Secret & Destructive Shell Hard Blocks** | Yes (`DET-01`/`02`/`03`) | Partial | No | No | Fragile regexes |
|
|
90
|
+
| **3x Failure Loop Breaker + FTS5 Search** | Yes (`DET-04`) | No | Partial | No | Rarely |
|
|
91
|
+
| **Non-Code `Read` Clamping (`16 KB` cap)** | Yes (`DET-06`) | No | Bash stdout only | No | Rarely |
|
|
92
|
+
| **Sub-15 ms Warm IPC Daemon + 0 deps** | Yes (`0` npm deps) | Network RTT | Native binary | Read-only CLI | Node cold start |
|
|
93
|
+
| **Turn-0 Config Lint & GitHub PR Cost Gate** | Yes | Cloud dashboard | No | Reports only | No |
|
|
94
|
+
|
|
95
|
+
## Permanent MIT Core & Privacy Audit
|
|
96
|
+
|
|
97
|
+
- **Permanent MIT Core & Zero-Telemetry Pledge:** Burnoff's core CLI, deterministic hooks (`DET-01`..`20`), Turn-0 linter, and CI budget gate will remain **100% MIT-licensed forever** with **zero outbound network requests** and **zero runtime npm dependencies**.
|
|
98
|
+
- **Security & Trust Documentation:** See [`SECURITY.md`](SECURITY.md) for credential scrubbing rules, fail-closed Ring-0 guarantees, exact file permissions (`0600`/`0700`), and vulnerability reporting. See [`SPONSORS.md`](SPONSORS.md) for sustainable open-source backing.
|
|
99
|
+
|
|
100
|
+
| Data / Path | Purpose | Outbound Network? | Ignored by Git? |
|
|
101
|
+
| :--- | :--- | :---: | :---: |
|
|
102
|
+
| `~/.burnoff/ledger.db` (or `.json`) | Local token savings & guard counts | **Never** | Yes (home dir) |
|
|
103
|
+
| `~/.burnoff/fts/` & `~/.burnoff/snooze/` | Archived long test logs & active `pause`/`bypass` state | **Never** | Yes (home dir) |
|
|
104
|
+
| `.claude/settings.local.json` & `.claude/burnoff-hook-shim.mjs` | Hook & `statusLine` wiring | **Never** | Yes (`.git/info/exclude`) |
|
|
105
|
+
|
|
106
|
+
<details>
|
|
107
|
+
<summary>Full Client Capability Matrix (Claude Code & Google Antigravity CLI)</summary>
|
|
108
|
+
|
|
109
|
+
| Capability | Claude Code | Google Antigravity CLI (experimental) |
|
|
110
|
+
| :--- | :---: | :---: |
|
|
111
|
+
| **DET-01 / 02 / 03** (Shell, secret & protected-file guards) | Yes | Yes (`decision: deny \| ask`) |
|
|
112
|
+
| **DET-04** (Runaway loop breaker) | Yes (`PostToolUse` / `PostToolUseFailure`) | Yes (`PostToolUse.error`) |
|
|
113
|
+
| **DET-05** (Subagent fan-out & prompt-bloat guard) | Yes (`Task` / `Agent`, advisory by default) | Yes (`invoke_subagent`, advisory by default) |
|
|
114
|
+
| **DET-06** (Bounded file-read clamp & overlap trim) | Yes (`updatedInput`) | Yes (`overwrite: { StartLine, EndLine }`) |
|
|
115
|
+
| **DET-07 / 08 / 09 / 10** (Flood bypass, test integrity, edit thrash, rewrite guards) | Yes (`ask` / quiet defaults) | Yes (`decision: ask \| deny`) |
|
|
116
|
+
| **DET-13 / 14 / 17 / BO-TTL-01** (`UserPromptSubmit` coach — opt-in) | Opt-in (`promptCoachEnabled: true`) | Not wired (Claude Code only) |
|
|
117
|
+
| **DET-15 / 18 / 19 / BO-MOD-01..02 / BO-MCP-11** (Budgets, thread-rot, model/effort) | Yes | Partial (`PreToolUse` only) |
|
|
118
|
+
| **DET-20** (Concurrent scope locks, quota brake & cold-read dedup) | Yes (`active_scopes.json`) | Yes |
|
|
119
|
+
| **`PostToolUse` FTS5 log archive & `WebFetch` <=4k cap** | Yes | No (`PostToolUse` returns `{}`) |
|
|
120
|
+
| **Turn-0 startup audit (`burnoff audit --startup`)** | Yes | Yes (`GEMINI.md`, `AGENTS.md`, `.agents/`) |
|
|
121
|
+
| **Local FinOps (`audit`, `pr-cost`, `ci-gate`)** | Yes | Yes (Gemini rate cards & `transcript.jsonl`) |
|
|
122
|
+
|
|
123
|
+
</details>
|
|
124
|
+
|
|
125
|
+
<details>
|
|
126
|
+
<summary>CLI Command Reference</summary>
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
| :--- | :--- |
|
|
130
|
+
| `burnoff` / `burnoff preview [--days 7]` | Run the 3-second zero-mutation read-only transcript preview receipt. |
|
|
131
|
+
| `burnoff init [--client auto\|claude\|antigravity\|both] [--no-statusline] [--global]` | Install hooks, auto-wire `statusLine`, and keep `git status` clean. |
|
|
132
|
+
| `burnoff pause [15m\|1h\|status\|off]` | Temporarily silence ask gates & read clamps while Ring-0 denies stay active. |
|
|
133
|
+
| `burnoff bypass [--grant <substr> \| -- <cmd...>]` | Grant a 1-use `DET-07` override or run a command directly outside clamps. |
|
|
134
|
+
| `burnoff allow-once <DET-ID> --scope <substr>` | Single-use scoped `ask` override (`snooze` for timed overrides). |
|
|
135
|
+
| `burnoff doctor [--gc] [--json]` | Run Node, SQLite FTS5, hook, warm daemon, and ledger diagnostics. |
|
|
136
|
+
| `burnoff audit [--startup [--ci] [--strict] [--github-annotations]]` | Audit local sessions or lint Turn-0 `CLAUDE.md`/`GEMINI.md`/`.mcp.json` bloat. |
|
|
137
|
+
| `burnoff pr-cost [--base main] [--write-summary [file]]` / `burnoff ci-gate [--summary <file>]` | Attribute branch spend, export zero-secret `.burnoff-ci/pr-summary.json` for ephemeral CI runners, & enforce `.burnoff.yaml` CI thresholds. |
|
|
138
|
+
| `burnoff team-digest [--days 7]` / `burnoff search <turnId> [kw]` | 5-line EM spend summary & FTS5 log search. |
|
|
139
|
+
| `burnoff daemon <start\|stop\|status>` | Manually inspect or manage the auto-spawned workspace IPC daemon. |
|
|
140
|
+
|
|
141
|
+
</details>
|
|
142
|
+
|
|
143
|
+
<details>
|
|
144
|
+
<summary>Team Policy (`.burnoff.yaml`), GitHub Actions CI Gates & Environment Variables</summary>
|
|
145
|
+
|
|
146
|
+
Commit `.burnoff.yaml` in your repo root to enforce shared policy across Claude Code and GitHub Actions (see [`.github/workflows/burnoff-pr-gate.yml`](.github/workflows/burnoff-pr-gate.yml) and [`.github/workflows/burnoff-startup-lint.yml`](.github/workflows/burnoff-startup-lint.yml)):
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
guards:
|
|
150
|
+
mode: guard
|
|
151
|
+
det04Threshold: 3
|
|
152
|
+
det09Action: advisory
|
|
153
|
+
promptCoachEnabled: false
|
|
154
|
+
readClamp:
|
|
155
|
+
enabled: true
|
|
156
|
+
maxLines: 250
|
|
157
|
+
maxBytes: 16384
|
|
158
|
+
neverClampCodeOffCliff: true
|
|
159
|
+
postTool:
|
|
160
|
+
fts5Enabled: true
|
|
161
|
+
minBytesToCompress: 6144
|
|
162
|
+
webFetchMaxTokens: 4000
|
|
163
|
+
ciBudgetGate:
|
|
164
|
+
maxPrCostUsd: 15
|
|
165
|
+
maxPrTokens: 1500000
|
|
166
|
+
minCacheHitPct: 50
|
|
167
|
+
maxWasteRatioPct: 35
|
|
168
|
+
wasteRatioBasis: actionable
|
|
169
|
+
maxRing0Violations: 0
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Ephemeral CI Runner Sync (Zero-Secret):** GitHub Actions runners lack local `~/.claude/projects/` transcripts. Run `burnoff pr-cost --write-summary` locally to export a scrubbed, SHA-256 integrity-verified `.burnoff-ci/pr-summary.json` (zero prompts, zero secrets, zero OS home paths) that `burnoff pr-cost` and `burnoff ci-gate` automatically hydrate and verify in CI.
|
|
173
|
+
|
|
174
|
+
**Environment Variables:**
|
|
175
|
+
- `BURNOFF_HOME` — Override `~/.burnoff/` state directory.
|
|
176
|
+
- `BURNOFF_IPC_PATH` — Override daemon pipe / socket path (disables auto-daemon spawn).
|
|
177
|
+
- `BURNOFF_NO_AUTO_DAEMON` — Set `1` to disable automatic background daemon launch on `SessionStart`.
|
|
178
|
+
- `BURNOFF_PRETOOL_FAIL_MODE` — Set `closed` to fail-closed on internal hook faults (`exitCode: 2` Ring-0 blocks always fail-closed).
|
|
179
|
+
- `BURNOFF_POST_OUTPUT_MODE` — Override `PostToolUse` output mode (`auto`, `updatedToolOutput`, `additionalContext`).
|
|
180
|
+
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
## Requirements, Plugin & License
|
|
184
|
+
|
|
185
|
+
- **Node.js `>=20.19.0`** (`Node.js >=22.13.0` recommended for built-in `node:sqlite` FTS5 indexing; JSON fallback runs automatically on earlier `>=20.19` releases).
|
|
186
|
+
- **Plugin & Status Line Docs:** [`docs/CLAUDE_CODE_PLUGIN.md`](docs/CLAUDE_CODE_PLUGIN.md) · [`docs/DESIGN_PARTNER_INTAKE.md`](docs/DESIGN_PARTNER_INTAKE.md)
|
|
187
|
+
- **License:** MIT — see [LICENSE](LICENSE).
|