vibeostheog 0.24.32 → 0.25.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/CHANGELOG.md CHANGED
@@ -1,23 +1,3 @@
1
- ## 0.24.32
2
- - feat: promote data-backed experimental regimes (#158)
3
- - feat: promote data-backed experimental regimes
4
- - fix: make footer state truthful
5
- - test: add live lifecycle regression
6
- - chore: v0.24.31 (#163)
7
- - chore: v0.24.28
8
- Merge pull request #162 from DrunkkToys/codex/test-production-proof
9
- Merge pull request #160 from DrunkkToys/codex/release-patch-0.24.28
10
- Fix clean CI sync for generated modules
11
- Fix CI sync for generated modules
12
- Fix CI artifact sync
13
- Sync generated flow rules
14
- Merge remote-tracking branch 'origin/master' into codex/release-patch-0.24.28
15
- Fix release CI regressions
16
- Merge pull request #159 from DrunkkToys/codex/release-patch-0.24.28
17
- Strengthen cascade lifecycle coverage
18
- Merge branch 'master' of https://github.com/DrunkkToys/vibeOS into codex/release-patch-0.24.28
19
-
20
-
21
1
  ## 0.24.31
22
2
  - fix: make footer state truthful
23
3
  - fix: quiet greetings should not inherit stale tdd tags
package/README.md CHANGED
@@ -1,18 +1,65 @@
1
- # vibeOS for OpenCode
1
+ # vibeOS for OpenCode — Innocence v0.25.0
2
2
 
3
3
  Cost-aware control plane for OpenCode Desktop.
4
4
 
5
- > ## v0.24.0 Return
6
- > Compact footer format: `🦠 brain | Deepseek | V4 Pro | $12.57 | VibeMaX ⚡ Budget`
7
- > VibeMaX is now the default optimization mode. Model display names cleaned up (V4 Pro, Sonnet, 2.5 Flash).
8
- > Install: `npx vibeostheog setup --project` or `npx vibeostheog setup`
9
- > Keeps expensive models on strategy, routes implementation to cheaper tiers, surfaces savings in real time.
5
+ OpenCode Desktop gives you access to the most capable language models ever created — Opus, Sonnet, DeepSeek v4 Pro — but running them on every single turn adds up fast. Most users do not think about token costs until the bill arrives, and by then the damage is done. You should not have to choose between using the best model and staying within budget. That choice is a distraction from the work that matters.
10
6
 
11
- For teams, vibeOS adds practical guardrails: delegation enforcement, flow and TDD controls, pattern learning, stress-aware routing, VibeBoX decision tracking, reporting, and remote API protection for the core algorithms.
7
+ Innocence is about removing that cognitive overhead entirely. vibeOS handles the economics behind the scenes routing, cascading, deferring, and optimizing every turn so you never have to think about cost again. You code with innocence. The plugin earns its keep silently.
12
8
 
13
- ## Delegation Enforcement
9
+ ## How It Feels
14
10
 
15
- Every `write`/`edit`/`notebookedit` on the **brain tier** is intercepted, cost-estimated, and blocked with a visible enforcement note. Work must be delegated to **medium** or **cheap**. This is the primary savings mechanism.
11
+ The first thing you notice is the footer. A single line at the bottom of every assistant response, barely visible, shows you what model handled the turn and how much you have saved this session. It is not a warning. It is not a nag. It is reassurance.
12
+
13
+ ```
14
+ - brain | Deepseek | V4 Pro | $12.57 | VibeMaX Budget
15
+ ```
16
+
17
+ When you write code, the system routes implementation work to cheaper tiers automatically if the brain is reserved for strategy. You never see a block screen. You never get a cost warning interrupting your flow. The enforcement happens transparently — the work gets done, just on the right tier.
18
+
19
+ The VibeBoX decision engine watches how you work. Are you exploring a new codebase? It keeps the cheap model active and stays out of your way. Are you converging on a solution? It quietly upgrades to full quality mode with strict enforcement. Are you stuck in a loop fixing the same test? It detects the frustration pattern and escalates before you ask. You never configure any of this. It just adapts.
20
+
21
+ The stress detector reads your messages for signs of frustration — repeated failures, urgency, abrupt tone. When it senses stress above a threshold, it upgrades your model tier automatically. You get the best possible assistance while you are in the weeds, and you never had to ask.
22
+
23
+ You forget vibeOS is even running. That is the point.
24
+
25
+ ## The ML Engine
26
+
27
+ vibeOS is not a collection of static rules. It is a learning system that patterns your work style and adapts the control plane in real time.
28
+
29
+ ### VibeUltraX Cascade
30
+
31
+ The flagship routing strategy. Every turn passes through a three-stage cascade:
32
+
33
+ 1. **Local proposal** — MagicCoder:7b (Ollama) generates an initial response at zero cost.
34
+ 2. **Flash review** — DeepSeek v4 Flash critiques and refines the proposal.
35
+ 3. **Pro polish** — DeepSeek v4 Pro applies final quality pass on complex sections.
36
+
37
+ Benchmarked at **107% of raw brain quality at 58% of cost**. Local inference is free; only the Flash and Pro stages incur API costs. This is the first routing strategy that Pareto-dominates the raw brain baseline — better quality, lower cost.
38
+
39
+ ### VibeBoX Decision Engine
40
+
41
+ At the core of vibeOS is a real-time decision engine that classifies every user turn into one of seven sub-regimes:
42
+
43
+ - **INIT / DIVERGENT / EXPLORING** — You are learning the codebase, asking questions, browsing. cheap model, relaxed enforcement. Stay out of your way.
44
+ - **REFINING** — You are iterating on a solution. Default mode: VibeMaX, auto-escalate on complexity.
45
+ - **CONVERGING / CLOSED** — You are finalizing. Full quality mode, brain tier, strict enforcement and flow checks.
46
+ - **LOOPING** — You are stuck. Speed mode, medium tier, cycle-breaking interventions.
47
+
48
+ Classification uses 11 derived features per turn: message length, code block density, question ratio, urgency signals, sentiment, complexity estimate, repetition, instruction density, and more. Four escalating intervention levels prevent infinite loops. PIVOT/SWITCH detection recognizes context changes and injects scope-confirmation directives.
49
+
50
+ When the VibeBoX is disabled, a lightweight `classifyTurnSimple` fallback distinguishes Q&A from implementation intent using regex patterns.
51
+
52
+ ### Stress-Aware Routing
53
+
54
+ A real-time stress scoring pipeline analyzes user messages for frustration signals. When stress exceeds 1.5 (on a 0–3 scale), any regime is escalated to quality mode. The stress gauge renders in the footer as a subtle indicator. Inoculation directives are injected into system prompts to adjust the assistant's tone — slower, more structured, more thorough.
55
+
56
+ ### Pattern Learner
57
+
58
+ Per-project friction and routine tracking. The pattern learner observes which tools you use, what errors recur, and where you spend most of your time. Over time, it surfaces optimization suggestions and learns struggle/tech co-occurrence mappings. Cross-project patterns are stored in `global-learning.json` and inform pricing hints and routing hints.
59
+
60
+ ## The Numbers
61
+
62
+ The savings are real and measurable. Every write/edit on the brain tier is intercepted, cost-estimated, and routed to a cheaper tier. A single blocked brain-tier write saves at least $0.026 over Opus-to-Sonnet delegation.
16
63
 
17
64
  ### Savings per Delegation
18
65
 
@@ -22,26 +69,22 @@ Every `write`/`edit`/`notebookedit` on the **brain tier** is intercepted, cost-e
22
69
  | Opus -> Sonnet | $0.0264 | $0.26 | $2.64 | $26.40 |
23
70
  | Sonnet -> Haiku | $0.0044 | $0.04 | $0.44 | $4.40 |
24
71
 
25
- Every blocked brain-tier write/edit saves at least $0.026 (Opus -> Sonnet). The running total is tracked in `~/.claude/delegation-state.json` and displayed in the live footer.
72
+ The running total is persisted in `~/.claude/delegation-state.json` and displayed in the live footer. Cache savings are tracked separately under `cache_savings_usd`.
26
73
 
27
- ## Model Tiers
74
+ ### Model Tiers
28
75
 
29
76
  Benchmarked on the DeepSeek v4 family. Prices based on 700 input + 300 output tokens per turn.
30
77
 
31
- > DeepSeek Chat costs $0/turn when routed through the Direct DeepSeek provider (no OpenRouter markup).
32
-
33
78
  | Slot | Model | API ID | Per Turn | Per 1K Turns | Tier |
34
79
  |------|-------|--------|----------|--------------|------|
35
80
  | brain | v4 Pro | `deepseek/deepseek-v4-pro` | $0.00057 | $0.58 | high |
36
81
  | medium | v4 Flash | `deepseek/deepseek-v4-flash` | $0.000182 | $0.18 | mid |
37
82
  | cheap | DeepSeek Chat | `deepseek/deepseek-chat` | $0.00 | $0.00 | budget |
38
- | cheap (local) | MagicCoder:7b | `magicoder:7b` (Ollama) | $0.00 | $0.00 | budget |
39
-
40
- *Source: `src/lib/pricing.ts`. Conservative estimates — savings are always understated.*
83
+ | cheap (local) | MagicCoder:7b | `magiccoder:7b` (Ollama) | $0.00 | $0.00 | budget |
41
84
 
42
- ## Optimization Modes
85
+ DeepSeek Chat costs $0/turn when routed through the Direct DeepSeek provider (no OpenRouter markup).
43
86
 
44
- ### Policy Comparison — Sorted by Quality Descending
87
+ ### Optimization Modes
45
88
 
46
89
  | Policy | Quality vs Brain | Cost vs Brain | Savings | Method |
47
90
  |--------|-----------------|--------------|---------|--------|
@@ -51,32 +94,15 @@ Benchmarked on the DeepSeek v4 family. Prices based on 700 input + 300 output to
51
94
  | VibeMaX | ~75% | 0.18x | 82% | trained cascade (conservative escalate) |
52
95
  | Budget | ~40% | 0.00x | 100% | direct routing |
53
96
 
54
- **VibeUltraX** — Cascade pipeline: MagicCoder:7b (local Ollama) proposes, v4 Flash reviews, v4 Pro refines. Benchmarked at **107% of Brain quality** at 58% cost (local inference is free, only Flash/Pro API calls cost).
55
-
56
- **VibeQMaX (Quality Max)** — Routes strategic turns through v4 Pro with full thinking, strict enforcement, strict flow checks, and quality TDD. Write/edit turns delegated to cheaper tiers per enforcement rules. Effective blended cost ~$0.00029/turn (50% of Raw Brain).
97
+ **VibeUltraX** — Local Ollama proposes, v4 Flash reviews, v4 Pro refines. 107% quality at 58% cost.
57
98
 
58
- **Raw Brain** — v4 Pro (no framework). Baseline for all comparisons. 100% quality at 1.00x cost.
99
+ **VibeQMaX** — Routes strategic turns through v4 Pro with full thinking, strict enforcement, strict flow checks, and quality TDD. Write/edit delegated per enforcement rules. Blended cost ~$0.00029/turn (50% of brain baseline).
59
100
 
60
- **VibeMaX (ML-Optimized, v0.23 Default)** — Intelligent cost-quality sweet spot. Routes through v4 Flash (medium) and uses a random forest classifier (29 trees, gini-split, trained on telemetry) to decide each turn. Classifies on 11 derived features: message length, code block density, urgency, complexity, repetition, question ratio, and more. Benchmarked at ~75% of Brain quality at 18% of cost.
101
+ **VibeMaX** — ML-optimized default. Routes through v4 Flash with a random forest classifier (29 trees, gini-split, trained on telemetry) that decides each turn. ~75% quality at 18% cost.
61
102
 
62
- **Budget** — DeepSeek Chat. Direct routing. ~40% quality at 0.00x cost. 100% savings.
103
+ **Budget** — DeepSeek Chat. Direct routing. ~40% quality at zero cost.
63
104
 
64
- ### Cost vs Quality Visual
65
-
66
- ```
67
- Quality
68
- baseline . Raw Brain . VibeQMaX
69
- 107% | . VibeUltraX
70
- ~75% | . VibeMaX (default)
71
- ~55% | . Speed
72
- ~40% | . Budget
73
- |
74
- +--------------------------------
75
- 1.0x 0.50x 0.32x 0.18x 0.00x
76
- Cost Multiplier
77
- ```
78
-
79
- ### Configuration Per Mode
105
+ ### Mode Configuration
80
106
 
81
107
  | Mode | Model | Thinking | Enforcement | Flow | TDD |
82
108
  |------|-------|----------|-------------|------|-----|
@@ -87,68 +113,40 @@ Quality
87
113
  | Speed | v4 Flash | off | relaxed | audit | lazy |
88
114
  | Budget | DeepSeek Chat | off | relaxed | audit | lazy |
89
115
 
90
- ### Benchmark Details
116
+ ### Auto-Mode Behavior
91
117
 
92
- All tests run with DeepSeek v4 family. Quality scores measured against Raw Brain (v4 Pro, full thinking, no vibeOS overhead). VibeMaX quality benchmark derived from real session telemetry with bootstrap confidence intervals (36 bootstrap samples). Pareto frontier computed from 70 holdout scenarios across 170 training samples via hyperparameter sweep. VibeUltra is the first mode that beats Raw Brain on both accuracy and cost — Pareto-dominant.
118
+ When auto-mode is active, the VibeBoX control vector is the authority. `syncControlSettings()` writes enforcement, flow, TDD, and thinking mode to `model-tiers.json` every turn:
93
119
 
94
- Benchmarked on 1000 simulated questions across 20 runs, using model accuracies from MMLU-Pro / GPQA Diamond with real error correlation data.
120
+ | Regime | Mode | Enforce | Flow | TDD | Tier | Think |
121
+ |--------|------|---------|------|-----|------|-------|
122
+ | INIT / DIVERGENT / EXPLORING / REFINING | VibeMaX | relaxed | audit | lazy | cheap | off |
123
+ | CONVERGING / CLOSED | quality | strict | strict | quality | brain | full |
124
+ | LOOPING | speed | relaxed | audit | lazy | medium | off |
95
125
 
96
- ## Features
126
+ Stress > 1.5 escalates any regime to quality mode regardless of the above mapping.
127
+
128
+ ## What You Get
97
129
 
98
130
  | Feature | What it does |
99
131
  |---------|-------------|
100
- | **Delegation enforcement** | Blocks write/edit on brain tier. Routes to medium or cheap. |
101
- | **Live savings footer** | Compact format: tier icon, provider, short model name, total savings, VibeBrand + mode. |
102
- | **Web dashboard** | SolidJS SPA with SSE real-time push. Model split, savings, session history, trinity controls. |
103
- | **Trinity runtime** | Switch tiers mid-session. Change optimization mode. Flow/TDD/enforcement toggles. |
104
- | **Flow enforcer** | Pattern-rule checks on write/edit. Extracts TODO/FIXME into append-only queue. |
105
- | **TDD enforcer** | Auto-creates test skeletons for changed source. Strict mode: TODO tests fail. |
106
- | **Pattern learner** | Tracks recurring struggle/routine patterns per project. |
107
- | **VibeBoX** | 7 sub-regimes, 11 features per turn, 4 loop intervention levels, PIVOT/SWITCH detection. Auto-mode maps regime to optimization mode. |
108
- | **Stress-aware routing** | Stress gauge in footer. Stress > 1.5 escalates to quality mode. |
109
- | **Cache savings** | Separate cache_savings_usd tracking for scratchpad cache hits. |
110
- | **Report tools** | report-save, report-list, report-read, research-audit. |
111
- | **MCP server** | Extended tool capabilities + dashboard serving + SSE push endpoint. |
112
- | **Remote API** | Fastify server at api.vibetheog.com. Token auth with seat/license management. |
113
- | **Session lock** | trinity lock on|off — freezes model at session start. |
114
-
115
- ## How It Works
116
-
117
- 8 hooks into OpenCode Desktop:
118
-
119
- | Hook | Purpose |
120
- |------|---------|
121
- | `experimental.text.complete` | Appends footer to assistant responses |
122
- | `experimental.chat.messages.transform` | Injects delegation protocol content |
123
- | `experimental.chat.system.transform` | Injects cost optimization, stress inoculation, enforcement directives |
124
- | `tool.execute.before` | Blocks write/edit on brain tier |
125
- | `tool.execute.after` | Injects delegation UI notes |
126
- | `message.updated` | Fallback footer for versions without text.complete |
127
- | `experimental.session.compacting` | Preserves savings state |
128
- | `shell.env` | Injects OPENCODE_MODEL_TIER and OPENCODE_MODEL |
129
-
130
- ## Local Models (Ollama)
131
-
132
- To use **MagicCoder:7b** or other local models with vibeOS and OpenCode Desktop:
133
-
134
- ### Setup
135
-
136
- 1. Install Ollama — `curl -fsSL https://ollama.ai/install.sh | sh`
137
- 2. Pull MagicCoder — `ollama pull magicoder:7b`
138
- 3. Add provider — In OpenCode settings, add an Ollama provider (default: http://localhost:11434)
139
- 4. Detect — Run `trinity rebuild` — MagicCoder:7b appears in the model dropdown
140
- 5. Assign slot — `trinity set cheap magicoder:7b`
141
-
142
- ### Minimum Hardware
143
-
144
- | Component | Minimum |
145
- |-----------|---------|
146
- | CPU | Apple Silicon (M1+) or x86_64 with AVX2 |
147
- | RAM | **16 GB** (MagicCoder:7b @ Q4_K_M uses ~5 GB + context overhead) |
148
- | GPU | Integrated (M1 16GB unified memory) or NVIDIA 6GB+ VRAM |
149
- | Storage | 4 GB free for model weights |
150
-
151
- > **Note**: Local models run entirely on your machine. vibeOS treats them as any other OpenCode provider — pricing shows $0.00/turn.
132
+ | Delegation enforcement | Blocks write/edit on brain tier, routes to cheaper tiers transparently |
133
+ | Live savings footer | Tier, provider, model name, total savings, mode one line of reassurance |
134
+ | Web dashboard | SolidJS SPA with SSE real-time push for model split, savings, session history, controls |
135
+ | Trinity runtime | Switch tiers mid-session, change optimization mode, toggle subsystems live |
136
+ | Flow enforcer | Pattern-rule checks on write/edit. Extracts TODO/FIXME into append-only queue. |
137
+ | TDD enforcer | Auto-creates test skeletons for changed source. Strict mode fails TODO tests. |
138
+ | Pattern learner | Tracks recurring struggle/routine patterns per project, cross-project too |
139
+ | VibeBoX | 7 sub-regimes, 11 features per turn, loop intervention, PIVOT/SWITCH detection |
140
+ | Stress-aware routing | Real-time stress scoring, auto-escalation, system prompt inoculation |
141
+ | Cache savings | Separate cache_savings_usd tracking for scratchpad cache hits |
142
+ | Report tools | report-save, report-list, report-read, research-audit |
143
+ | MCP server | Extended tool capabilities + dashboard serving + SSE push endpoint |
144
+ | Remote API | Fastify server at api.vibetheog.com with token auth and seat management |
145
+ | Session lock | trinity lock on|off — freezes model at session start |
146
+ | Model locking | Per-session lock that skips auto-reconcile with OpenCode config changes |
147
+ | Blackbox decision engine | Dialogue trajectory tracking, loop prevention, outcome calibration |
148
+ | TensorTAG routing | WBP protocol synthesizes delegated task output in assistant chat |
149
+ | Pattern learner runtime | trinity patterns and trinity patterns clear |
152
150
 
153
151
  ## Install
154
152
 
@@ -158,7 +156,7 @@ npx vibeostheog setup # global ~/.config/opencode/
158
156
  npx vibeostheog setup --help # full usage
159
157
  ```
160
158
 
161
- One-command setup: deploys plugin files and registers in opencode.json. Restart OpenCode Desktop.
159
+ One command. Deploys plugin files and registers in opencode.json. Restart OpenCode Desktop.
162
160
 
163
161
  Local dev checkout:
164
162
 
@@ -175,7 +173,7 @@ Local dev checkout:
175
173
  | Command | Effect |
176
174
  |---------|--------|
177
175
  | `trinity status` | Tier, enforcement, savings, stress, lock state |
178
- | `trinity set brain\|medium\|cheap [model=<model_id>]` | Switch active model tier or override the slot model |
176
+ | `trinity set brain\|medium\|cheap [model=<model_id>]` | Switch active model tier or override slot |
179
177
  | `trinity brain\|medium\|cheap` | Shorthand tier switch |
180
178
  | `trinity enable\|disable` | Toggle plugin on/off |
181
179
  | `trinity mode budget\|quality\|speed\|longrun\|auto` | Set optimization mode |
@@ -197,68 +195,50 @@ Local dev checkout:
197
195
 
198
196
  **Report commands**: report-save, report-list, report-read, research-audit
199
197
 
200
- ## Live Footer
201
-
202
- ```
203
- — 🦠 brain | Deepseek | V4 Pro | $12.57 | VibeMaX ⚡ Budget
204
- ```
205
-
206
- Tier icon + lowercase quality (🦠 brain / ⚙ medium / ⚡ cheap), provider label, cleaned model name, total savings, VibeBrand + flash icon + mode. Persisted in ~/.claude/delegation-state.json.
198
+ ## Under the Hood
207
199
 
208
- ## Architecture
200
+ ### Architecture
209
201
 
210
- ### Plugin Source
202
+ vibeOS hooks into OpenCode Desktop through 8 extension points:
211
203
 
212
- Single-file runtime `dist/vibeOS.js` (generated from `src/index.ts`). TypeScript source of truth at `src/index.ts`, `src/vibeOS-lib/*.ts`, and `src/utils/*.ts`. Build: `npm run build` (tsc compile + sync-ts-build + bundle + deploy script).
213
-
214
- ### State Files (~/.claude/)
215
-
216
- | File | Purpose |
204
+ | Hook | Purpose |
217
205
  |------|---------|
218
- | delegation-state.json | Sessions, warns, cache hits, lifetime totals |
219
- | model-tiers.json | brain/medium/cheap model IDs |
220
- | project-states.json | Per-project memory, analytics, report references |
221
- | reports/ | Saved report JSON files |
222
- | savings-ledger.jsonl | Append-only savings and credit event log |
223
- | global-learning.json | Cross-project pattern learning, pricing hints |
224
- | model-pricing-cache.json | Cached pricing by model ID |
225
- | active-jobs.json | In-flight delegation records |
226
- | blackbox-state.json | Per-project resolution tracker, session outcomes |
227
- | .flow-todo-queue.jsonl | Flow enforcer TODO queue |
228
- | .flow-dedup-keys.json | Deduplication set for flow TODO |
229
- | .enforcement-cooldown.jsonl | Per-tool cooldown for warn coalescing |
230
-
231
- ### Local vs Remote
232
-
233
- **Fully functional locally:** Model tier classification, static pricing, stress scoring, context budget, turn classification, TDD skeleton generation, flow enforcement, savings ledger, session metrics, reports, footer, dashboard, smart cache, VibeBoX fallback.
234
-
235
- **Requires remote API (api-token):** Bootstrap token exchange, advanced VibeBoX with full session history, dynamic per-prompt delegation, cross-session calibration, live pricing fetch beyond static map, learned subagent routing.
236
-
237
- When the remote API is unreachable, the plugin degrades gracefully to rule-based local algorithms. Core enforcement features continue working.
206
+ | `experimental.text.complete` | Appends footer to assistant responses |
207
+ | `experimental.chat.messages.transform` | Injects delegation protocol content |
208
+ | `experimental.chat.system.transform` | Injects cost optimization, stress inoculation, enforcement directives |
209
+ | `tool.execute.before` | Blocks write/edit on brain tier |
210
+ | `tool.execute.after` | Injects delegation UI notes |
211
+ | `message.updated` | Fallback footer for versions without text.complete |
212
+ | `experimental.session.compacting` | Preserves savings state |
213
+ | `shell.env` | Injects OPENCODE_MODEL_TIER and OPENCODE_MODEL |
238
214
 
239
- ### VibeBoX Decision Engine
215
+ ### State Files (~/.claude/)
240
216
 
241
- 7 sub-regimes (INIT, DIVERGENT, EXPLORING, REFINING, CONVERGING, CLOSED, LOOPING). Classification via entropy trends, action consistency, feature contradiction, embedding drift. 11 derived features per turn. 4 loop intervention levels. PIVOT/SWITCH detection. Outcome tracking from satisfaction signals.
217
+ The plugin persists state to `~/.claude/` for cross-session continuity:
242
218
 
243
- Regime -> mode mapping via syncControlSettings():
219
+ - **delegation-state.json** Sessions, warns, cache hits, lifetime totals
220
+ - **model-tiers.json** — Brain/medium/cheap model IDs
221
+ - **project-states.json** — Per-project memory, analytics, report references
222
+ - **blackbox-state.json** — Per-project resolution tracker, session outcomes
223
+ - **savings-ledger.jsonl** — Append-only savings event log
224
+ - **global-learning.json** — Cross-project pattern learning
225
+ - **active-jobs.json** — In-flight delegation records
244
226
 
245
- | Regime | Mode | Enforce | Flow | TDD | Tier | Think |
246
- |--------|------|---------|------|-----|------|-------|
247
- | INIT / DIVERGENT / EXPLORING / REFINING | vibemax (default) | relaxed | audit | lazy | cheap | off |
248
- | CONVERGING / CLOSED | quality | strict | strict | quality | brain | full |
249
- | LOOPING | speed | relaxed | audit | lazy | medium | off |
227
+ ### Local vs Remote
250
228
 
251
- Stress > 1.5 escalates any regime to quality.
229
+ Core features work fully offline: model tier classification, static pricing, stress scoring, context budget, VibeBoX fallback, TDD skeletons, flow enforcement, savings ledger, session metrics, reports, footer, dashboard.
252
230
 
253
- ### Remote API Server
231
+ Remote API (api.vibetheog.com) enables: bootstrap token exchange, advanced VibeBoX with full session history, dynamic per-prompt delegation, cross-session calibration, live pricing fetch, learned subagent routing. Falls back gracefully when unreachable.
254
232
 
255
- `src/vibeOS-api-server/` Fastify + SQLite at api.vibetheog.com. Endpoints: delegation check, tier routing, stress scoring, VibeBoX analysis/calibration, TDD skeleton gen, pattern observation, pricing fetch, context compression. Auth via VIBEOS_API_TOKEN. Client: `src/vibeOS-api-server/client.js` with automatic local fallback.
233
+ ### Live Footer
256
234
 
257
- ### Dashboard
235
+ ```
236
+ - brain | Deepseek | V4 Pro | $12.57 | VibeMaX Budget
237
+ ```
258
238
 
259
- SolidJS SPA at `src/dashboard/`. Build: `npm run build:dashboard` (vite). Served by MCP server or standalone. SSE /events for real-time push.
239
+ Format: tier label, provider, short model name, total savings this session, VibeBrand + mode. Updates every turn. Persisted in `~/.claude/delegation-state.json`.
260
240
 
261
- ## Environment Variables
241
+ ### Environment Variables
262
242
 
263
243
  | Variable | Default | Effect |
264
244
  |----------|---------|--------|
@@ -268,15 +248,14 @@ SolidJS SPA at `src/dashboard/`. Build: `npm run build:dashboard` (vite). Served
268
248
  | VIBEOS_API_BOOTSTRAP_TOKEN | unset | Bootstrap exchange |
269
249
  | VIBEOS_API_ENABLED | true | Set false for local-only |
270
250
  | CLAUDE_CREDIT_PERCENT | 100 | Credit override |
271
- | CLAUDE_CONTEXT7_AVAILABLE | unset | Context7 optimization |
272
251
  | VIBEOS_MCP_PORT | 3001 | MCP server port |
273
252
 
274
- ## Troubleshooting
253
+ ### Troubleshooting
275
254
 
276
255
  | Symptom | Fix |
277
256
  |---------|-----|
278
257
  | Plugin not loading | Check opencode.json entry. Restart Desktop. |
279
- | Model won't switch | `trinity rebuild` then `trinity set brain|medium|cheap` |
258
+ | Model won't switch | `trinity rebuild` then `trinity set brain\|medium\|cheap` |
280
259
  | Writes/edits blocked | Enforcement active — delegate to cheap tier |
281
260
  | No footer visible | Verify plugin enabled, completions running |
282
261
  | Dashboard blank | `npm run build` then restart |
package/dist/vibeOS.js CHANGED
@@ -11276,22 +11276,24 @@ function regimeAwareToolStyleDirective(regime, mode, stress) {
11276
11276
  const normalizedRegime = String(regime || "INIT").toUpperCase();
11277
11277
  const normalizedMode = String(mode || "budget").toLowerCase();
11278
11278
  const stressLabel = stress > 1.5 ? "high stress" : stress > 0.4 ? "elevated stress" : "calm";
11279
- const regimeToneByName = {
11280
- INIT: "The session is starting, so keep descriptions lightweight, status-oriented, and easy to scan.",
11281
- DIVERGENT: "The session is branching, so keep descriptions exploratory and open to alternatives without sounding vague.",
11282
- EXPLORING: "The session is investigating, so keep descriptions discovery-oriented, specific, and lightweight.",
11283
- REFINING: "The session is polishing implementation, so keep descriptions action-oriented, concrete, and tied to the next visible code step.",
11284
- IMPLEMENTING: "The session is executing implementation work, so keep descriptions exact, build-focused, and next-step driven.",
11285
- RESEARCH: "The session is researching, so keep descriptions evidence-seeking, careful, and explicit about what was checked.",
11286
- REVIEWING: "The session is reviewing, so keep descriptions audit-style, traceable, and focused on proof.",
11287
- DESIGNING: "The session is designing, so keep descriptions structured, intent-driven, and aligned to the target shape.",
11288
- CONVERGING: "The session is converging, so keep descriptions closure-oriented, exact, and ready for final verification.",
11289
- CLOSED: "The session is closing, so keep descriptions final, concise, and clearly outcome-focused.",
11290
- LOOPING: "The session is looping, so keep descriptions verification-first, state-aware, and loop-breaking.",
11291
- AUDIT: "The session is auditing, so keep descriptions evidence-first, compliance-aware, and traceable.",
11292
- FORENSIC: "The session is doing forensic work, so keep descriptions investigative, reproducible, and proof-heavy."
11293
- };
11294
- const regimeTone = regimeToneByName[normalizedRegime] || "The session should stay aligned to the active regime and avoid generic filler.";
11279
+ const regimeTone = (() => {
11280
+ if (normalizedRegime === "LOOPING") {
11281
+ return "The session is looping, so keep descriptions verification-first, state-aware, and loop-breaking.";
11282
+ }
11283
+ if (normalizedRegime === "CONVERGING" || normalizedRegime === "CLOSED") {
11284
+ return "The session is converging, so keep descriptions closure-oriented, exact, and ready for final verification.";
11285
+ }
11286
+ if (normalizedRegime === "REFINING" || normalizedRegime === "IMPLEMENTING") {
11287
+ return "The session is building, so keep descriptions action-oriented, concrete, and tied to the next visible code step.";
11288
+ }
11289
+ if (normalizedRegime === "REVIEWING" || normalizedRegime === "AUDIT" || normalizedRegime === "FORENSIC") {
11290
+ return "The session is reviewing evidence, so keep descriptions investigative, traceable, and focused on proof.";
11291
+ }
11292
+ if (normalizedRegime === "RESEARCH" || normalizedRegime === "DESIGNING" || normalizedRegime === "EXPLORING" || normalizedRegime === "DIVERGENT" || normalizedRegime === "INIT") {
11293
+ return "The session is exploring, so keep descriptions discovery-oriented, specific, and lightweight.";
11294
+ }
11295
+ return "The session should stay aligned to the active regime and avoid generic filler.";
11296
+ })();
11295
11297
  return `[tool style: dopamine] Active regime: ${normalizedRegime}; mode: ${normalizedMode}; stress: ${stressLabel}. When calling the bash tool, use a short, calm, progress-focused description that matches the current regime. ${regimeTone} Name the user-visible milestone being advanced, keep the wording human, and avoid hype or raw technical labels. Combine independent bash commands into a single call with && or ;.`;
11296
11298
  }
11297
11299
  function flowTodosDirective() {
@@ -11574,21 +11576,6 @@ var REGIME_TAG = {
11574
11576
  AUDIT: "AUDT",
11575
11577
  FORENSIC: "FRNC"
11576
11578
  };
11577
- var REGIME_ICON = {
11578
- INIT: "\u25CC",
11579
- DIVERGENT: "\u21C4",
11580
- EXPLORING: "\u2315",
11581
- REFINING: "\u270E",
11582
- IMPLEMENTING: "\u2699",
11583
- RESEARCH: "\u2301",
11584
- REVIEWING: "\u2713",
11585
- DESIGNING: "\u25EB",
11586
- CONVERGING: "\u27F2",
11587
- CLOSED: "\u25C6",
11588
- LOOPING: "\u21BB",
11589
- AUDIT: "\u2611",
11590
- FORENSIC: "\u27C1"
11591
- };
11592
11579
  var BRAND_MAP = {
11593
11580
  vibeultrax: "VibeUltraX",
11594
11581
  vibeqmax: "VibeQMaX",
@@ -11610,9 +11597,6 @@ function resolveBrand(optMode, activeSlot) {
11610
11597
  function resolveTierIcon(slot) {
11611
11598
  return TIER_ICON[slot] || "\u26A1";
11612
11599
  }
11613
- function resolveRegimeIcon(subRegime) {
11614
- return REGIME_ICON[String(subRegime || "").toUpperCase()] || "\u25E6";
11615
- }
11616
11600
  function formatModeLabel(optMode) {
11617
11601
  const normalized = String(optMode || "").toLowerCase();
11618
11602
  if (!normalized)
@@ -11693,9 +11677,8 @@ function buildFooterLine(input) {
11693
11677
  const { activeSlot, sessionSlot, providerLabel, modelName, ltTotal, ltTrend, vibeBrand, optMode, flashIcon, enfTags, vectorChangedSlot, subRegime } = input;
11694
11678
  const tierIcon = resolveTierIcon(activeSlot);
11695
11679
  const regimeTag = subRegime ? REGIME_TAG[subRegime] || subRegime.slice(0, 4) : null;
11696
- const regimeIcon = subRegime ? resolveRegimeIcon(subRegime) : null;
11697
11680
  const modeLabel = formatModeLabel(optMode);
11698
- let line = `\u2014 ${tierIcon} ${activeSlot} | ${providerLabel} | ${modelName}${regimeTag ? ` \u25B6 ${regimeIcon} ${regimeTag}` : ""}`;
11681
+ let line = `\u2014 ${tierIcon} ${activeSlot} | ${providerLabel} | ${modelName}${regimeTag ? ` \u25B6 ${regimeTag}` : ""}`;
11699
11682
  if (ltTotal > 0) {
11700
11683
  const savingsPulse = formatSavingsPulse(ltTotal, ltTrend);
11701
11684
  if (savingsPulse)
@@ -12036,7 +12019,7 @@ import { writeFileSync as writeFileSync14, appendFileSync as appendFileSync6, ex
12036
12019
  import { join as join17, dirname as dirname12, basename as basename4 } from "node:path";
12037
12020
  import { createHash as createHash5 } from "node:crypto";
12038
12021
 
12039
- // src/lib/cost-anomaly.ts
12022
+ // src/lib/cost-anomaly.js
12040
12023
  var COST_WINDOW_SIZE = 20;
12041
12024
  var COST_ANOMALY_THRESHOLD = 3;
12042
12025
  var COST_WARMUP_SAMPLES = 5;
@@ -12047,21 +12030,26 @@ var CostAnomalyDetector = class {
12047
12030
  currentAnomalyCost = 0;
12048
12031
  currentAnomalyMean = 0;
12049
12032
  record(cost) {
12050
- if (this.disabled) return;
12033
+ if (this.disabled)
12034
+ return;
12051
12035
  this.costHistory.push(cost);
12052
12036
  if (this.costHistory.length > COST_WINDOW_SIZE) {
12053
12037
  this.costHistory.shift();
12054
12038
  }
12055
12039
  }
12056
12040
  get mean() {
12057
- if (this.costHistory.length === 0) return 0;
12041
+ if (this.costHistory.length === 0)
12042
+ return 0;
12058
12043
  return this.costHistory.reduce((a, b) => a + b, 0) / this.costHistory.length;
12059
12044
  }
12060
12045
  checkAnomaly(model, cost) {
12061
- if (this.disabled) return false;
12062
- if (this.costHistory.length < COST_WARMUP_SAMPLES) return false;
12046
+ if (this.disabled)
12047
+ return false;
12048
+ if (this.costHistory.length < COST_WARMUP_SAMPLES)
12049
+ return false;
12063
12050
  const avg = this.mean;
12064
- if (avg <= 0 || cost <= avg) return false;
12051
+ if (avg <= 0 || cost <= avg)
12052
+ return false;
12065
12053
  const ratio = cost / avg;
12066
12054
  if (ratio > COST_ANOMALY_THRESHOLD) {
12067
12055
  this.currentAnomalyModel = model;
@@ -12083,7 +12071,8 @@ var CostAnomalyDetector = class {
12083
12071
  };
12084
12072
  var _costDetector = null;
12085
12073
  function getCostAnomalyDetector() {
12086
- if (!_costDetector) _costDetector = new CostAnomalyDetector();
12074
+ if (!_costDetector)
12075
+ _costDetector = new CostAnomalyDetector();
12087
12076
  return _costDetector;
12088
12077
  }
12089
12078
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.24.32",
3
+ "version": "0.25.0",
4
4
  "description": "Cost-aware delegation enforcer for OpenCode. Tracks model usage, routes Task subagents to cheaper tiers, surfaces cumulative savings in chat. Includes research audit, reporting framework, project memory, progressive scratchpad decadence, and trinity CLI for brain/medium/cheap slot switching.",
5
5
  "scripts": {
6
6
  "release": "node scripts/release.mjs",
@@ -13,7 +13,7 @@
13
13
  "deploy": "node scripts/deploy.mjs",
14
14
  "typecheck": "tsc -p tsconfig.json --noEmit",
15
15
  "checkpoint:validate": "node scripts/checkpoint-validate.mjs",
16
- "test:scripts": "node --test scripts/tests/checkpoint-validate.test.mjs tests/release-pack.test.mjs",
16
+ "test:scripts": "node scripts/run-test-suite.mjs scripts",
17
17
  "ts:audit": "node scripts/ts-audit.mjs",
18
18
  "test": "npm run build:bundle && node scripts/run-test-suite.mjs full",
19
19
  "test:ci": "npm run build:bundle && node scripts/run-test-suite.mjs ci",