vibeostheog 0.18.15 → 0.19.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 +16 -0
- package/README.md +88 -126
- package/package.json +2 -2
- package/scripts/deploy.mjs +9 -5
- package/src/index.js +1421 -599
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.19.0
|
|
2
|
+
- feat: quality governance — self-protection, 2h release gate, outcome tracking (#44)
|
|
3
|
+
- fix: chooseEpisodeMode defaults to budget (was always quality) + simplify isApiConnected check
|
|
4
|
+
- fix: stress mitigation directive uses raw stress score, not API-scaled
|
|
5
|
+
- fix: _refreshModel respects project-local opencode.json over bootstrap default slot
|
|
6
|
+
- docs: mark v0.19.0 as alpha milestone release
|
|
7
|
+
Merge pull request #47 from DrunkkToys/codex/status-lock-backend-fix
|
|
8
|
+
Expose status lock and backend state
|
|
9
|
+
Fix stress mitigation and TDD smoke coverage
|
|
10
|
+
Rebuild bundle after telemetry merge
|
|
11
|
+
Add privacy-preserving telemetry capture
|
|
12
|
+
Refresh public README
|
|
13
|
+
Extract runtime surface for easier maintenance
|
|
14
|
+
Fix budget-first mode and stabilize tests
|
|
15
|
+
|
|
16
|
+
|
|
1
17
|
## 0.18.15
|
|
2
18
|
- fix: session records missing started/session_started_at fields (v0.18.12)
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -1,175 +1,137 @@
|
|
|
1
1
|
# vibeOS for OpenCode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Alpha Release** — This is the first alpha milestone of vibeOS. See [CHANGELOG.md](CHANGELOG.md) for release notes.
|
|
4
|
+
vibeOS is the cost-aware routing layer for OpenCode Desktop. It keeps high-tier models focused on orchestration, pushes implementation work to cheaper tiers, and makes the savings visible in real time through the live footer and dashboard.
|
|
4
5
|
|
|
5
|
-
The core is the VIBE autoswitcher: a decision engine that routes each request to the right tier based on context, enforcement policy, and session state. You stay in control via the `trinity` tool set, but the default workflow is zero-config.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
It also adds guardrails: delegation enforcement, flow and TDD controls, pattern learning, stress-aware routing, blackbox decision tracking, reporting, and remote API protection for the core algorithms.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Why Teams Use It
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## What It Does
|
|
17
|
-
|
|
18
|
-
- **Smart delegation** — Blocks direct write/edit on high-tier models and routes work to cheaper subagents
|
|
19
|
-
- **Cost tracking** — Tracks estimated savings from delegation events and cache hits, displayed in a live footer
|
|
20
|
-
- **trinity commands** — Runtime controls for model switching, enforcement toggles, audits, and diagnostics
|
|
21
|
-
- **Flow enforcer** — Validates write/edit patterns against project rules; optionally extracts TODOs/FIXMEs
|
|
22
|
-
- **TDD enforcer** — Auto-creates test skeletons for changed source files; strict mode makes TODO tests fail loudly
|
|
23
|
-
- **Project guard** — Protects AGENTS.md and README.md in every project with auto-regeneration
|
|
24
|
-
- **Pattern learner** — Detects recurring friction and routine patterns per project, surfaces via `trinity patterns`
|
|
25
|
-
- **Stress mitigation** — Detects user stress signals, adjusts tier routing, and injects protective prompts
|
|
26
|
-
- **Model locking** — Prevents auto-switching when model is changed in the OpenCode GUI (`trinity lock`)
|
|
27
|
-
- **Report & audit** — `report-save`, `report-list`, `report-read`, and `research-audit` tools
|
|
28
|
-
- **Worker-to-Brain protocol** — Delegates implementation tasks to cheaper subagents, synthesizes results in-chat
|
|
29
|
-
- **Web dashboard** — Real-time status, savings, stress gauge, and controls via browser
|
|
30
|
-
- **TUI sidebar** — Plugin status and controls via OpenCode sidebar plugin
|
|
31
|
-
- **Blackbox decision engine** — Dialogue trajectory tracking with loop prevention, pivot detection, and outcome tracking
|
|
11
|
+
- Routes work to the right model tier without manual babysitting
|
|
12
|
+
- Tracks delegation savings and cache savings separately
|
|
13
|
+
- Shows live status in chat, the footer, and the web dashboard
|
|
14
|
+
- Adds runtime controls for flow, TDD, model locking, and blackbox mode
|
|
15
|
+
- Falls back to local algorithms if the remote API is unavailable
|
|
32
16
|
|
|
33
17
|
## Install
|
|
34
18
|
|
|
35
|
-
###
|
|
19
|
+
### OpenCode plugin
|
|
20
|
+
|
|
21
|
+
1. Install the package:
|
|
36
22
|
|
|
37
23
|
```bash
|
|
38
24
|
npm install vibeOS
|
|
39
25
|
```
|
|
40
26
|
|
|
41
|
-
Register in `~/.config/opencode/opencode.json`:
|
|
27
|
+
2. Register it in `~/.config/opencode/opencode.json`:
|
|
42
28
|
|
|
43
29
|
```json
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
{
|
|
31
|
+
"plugins": [
|
|
32
|
+
{ "id": "vibeOS", "path": "node_modules/vibeOS/src/index.js" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
47
35
|
```
|
|
48
36
|
|
|
49
|
-
### Local
|
|
50
|
-
|
|
51
|
-
Copy the plugin and lib files to `~/.config/opencode/plugins/`. See the repository for the complete file list.
|
|
37
|
+
### Local plugin file
|
|
52
38
|
|
|
53
|
-
|
|
39
|
+
If you keep a local copy of the plugin, point OpenCode at the built file instead:
|
|
54
40
|
|
|
55
41
|
```json
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
{
|
|
43
|
+
"plugins": [
|
|
44
|
+
{ "id": "vibeOS", "path": "~/.config/opencode/plugins/vibeOS.js" }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
59
47
|
```
|
|
60
48
|
|
|
61
|
-
Restart OpenCode Desktop
|
|
62
|
-
|
|
63
|
-
## trinity Commands
|
|
64
|
-
|
|
65
|
-
| Command | Description |
|
|
66
|
-
|---|---|
|
|
67
|
-
| `trinity status` | Show current plugin state |
|
|
68
|
-
| `trinity set brain\|medium\|cheap` | Switch model slot |
|
|
69
|
-
| `trinity brain\|medium\|cheap` | Shorthand slot switch |
|
|
70
|
-
| `trinity enable` / `trinity disable` | Toggle plugin on/off |
|
|
71
|
-
| `trinity thinking full\|brief\|off` | Set reasoning depth |
|
|
72
|
-
| `trinity enforce on\|off` | Toggle delegation enforcement |
|
|
73
|
-
| `trinity lock on\|off` | Toggle model locking |
|
|
74
|
-
| `trinity flow on\|off` | Toggle flow enforcer |
|
|
75
|
-
| `trinity flow enforce on\|off` | Toggle auto TODO extraction |
|
|
76
|
-
| `trinity tdd on\|off` | Toggle test skeleton gen |
|
|
77
|
-
| `trinity tdd strict on\|off` | Toggle strict mode |
|
|
78
|
-
| `trinity tdd quality on\|off` | Toggle quality mode |
|
|
79
|
-
| `trinity blackbox on\|off\|status\|reset` | Decision engine controls |
|
|
80
|
-
| `trinity project` | Per-project analytics |
|
|
81
|
-
| `trinity patterns` / `trinity patterns clear` | Inspect / clear patterns |
|
|
82
|
-
| `trinity guard` | Regenerate project guard files |
|
|
83
|
-
| `trinity diagnose` | Run diagnostics |
|
|
84
|
-
| `trinity rebuild` | Auto-detect available models |
|
|
85
|
-
| `trinity help` | Command reference |
|
|
86
|
-
|
|
87
|
-
## Footer Format
|
|
88
|
-
|
|
89
|
-
Typical output footer:
|
|
49
|
+
Restart OpenCode Desktop after changing the config.
|
|
90
50
|
|
|
91
|
-
|
|
92
|
-
— [model route] | VibeTheOG: <total> saved <arrow> —
|
|
93
|
-
```
|
|
51
|
+
## Backend Root
|
|
94
52
|
|
|
95
|
-
The
|
|
53
|
+
The backend lives at the Desktop-level sibling folder `../vibeOScore`.
|
|
96
54
|
|
|
97
|
-
|
|
55
|
+
Use that folder when you need the API server, MCP server, or dashboard build chain:
|
|
98
56
|
|
|
99
57
|
```bash
|
|
100
|
-
npm run
|
|
101
|
-
npm run
|
|
58
|
+
npm run start
|
|
59
|
+
npm run start:all
|
|
60
|
+
npm run build:dashboard
|
|
61
|
+
npm run dev:dashboard
|
|
62
|
+
npm run dashboard:serve
|
|
63
|
+
npm run typecheck
|
|
64
|
+
npm test
|
|
102
65
|
```
|
|
103
66
|
|
|
104
|
-
|
|
67
|
+
## Core Controls
|
|
105
68
|
|
|
106
|
-
|
|
69
|
+
Use `trinity help` for the full command list. The most common controls are:
|
|
107
70
|
|
|
108
|
-
|
|
71
|
+
- `trinity status` - show current tier, enforcement, savings, stress, and lock state
|
|
72
|
+
- `trinity set brain|medium|cheap` - switch the active tier
|
|
73
|
+
- `trinity brain|medium|cheap` - shorthand tier switch
|
|
74
|
+
- `trinity rebuild` - re-detect available models and repopulate slots
|
|
75
|
+
- `trinity enable` / `trinity disable` - toggle the plugin on or off
|
|
76
|
+
- `trinity mode budget|quality|speed|longrun|auto` - change the optimization mode
|
|
77
|
+
- `trinity thinking full|brief|off` - change reasoning depth
|
|
78
|
+
- `trinity enforce on|off` - control delegation enforcement
|
|
79
|
+
- `trinity lock on|off` - freeze the active model for the session
|
|
80
|
+
- `trinity flow on|off` and `trinity flow enforce on|off` - manage flow checks
|
|
81
|
+
- `trinity tdd on|off`, `trinity tdd strict on|off`, `trinity tdd quality on|off` - manage test skeleton behavior
|
|
82
|
+
- `trinity project` - open project analytics
|
|
83
|
+
- `trinity patterns` / `trinity patterns clear` - inspect or reset learned patterns
|
|
84
|
+
- `trinity diagnose` - run a health check
|
|
85
|
+
- `trinity repair-state preview|apply` - fix state fingerprint collisions
|
|
86
|
+
- `trinity blackbox on|off|status|reset` - control the decision engine
|
|
87
|
+
- `trinity guard` - refresh AGENTS.md and README.md checks
|
|
88
|
+
- `trinity api-token <token>` - update the remote API token
|
|
109
89
|
|
|
110
|
-
|
|
111
|
-
- **Graceful degradation** — If the token is revoked or the API is unreachable, the plugin falls back to local-only mode with bundled algorithms. No functionality is lost; only remote-optimized routing is disabled.
|
|
112
|
-
- **Never commit tokens** — `.env.production` and `PRODUCTION-CREDENTIALS.md` are gitignored. Do not share or hardcode tokens in source files.
|
|
113
|
-
- **Token rotation** — Generate a new token and update `VIBEOS_API_TOKEN` if you suspect a leak. Old tokens are invalidated immediately on seat suspension.
|
|
114
|
-
- **Local-only mode** — Without an API token, all algorithms run locally. Set `VIBEOS_API_ENABLED=false` to explicitly disable all remote calls.
|
|
90
|
+
Additional reporting commands:
|
|
115
91
|
|
|
116
|
-
|
|
92
|
+
- `report-save`
|
|
93
|
+
- `report-list`
|
|
94
|
+
- `report-read`
|
|
95
|
+
- `research-audit`
|
|
117
96
|
|
|
118
|
-
|
|
97
|
+
## Savings And Footer
|
|
119
98
|
|
|
120
|
-
|
|
99
|
+
The footer shows:
|
|
121
100
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
101
|
+
- the active model split
|
|
102
|
+
- cumulative delegation savings
|
|
103
|
+
- cache savings
|
|
104
|
+
- stress level
|
|
105
|
+
- lock and enforcement tags
|
|
125
106
|
|
|
126
|
-
|
|
107
|
+
Savings are persisted in `~/.claude/delegation-state.json`.
|
|
127
108
|
|
|
128
|
-
|
|
129
|
-
- **System prompt injection** — When context7 is detected, a cost-policy directive is injected into every system prompt instructing the model to prefer `mcp__context7__resolve-library-id` and `mcp__context7__get-library-docs` over WebFetch/WebSearch for documentation URLs.
|
|
130
|
-
- **Urgency levels** — Controlled by the blackbox engine:
|
|
131
|
-
- `required` (strict/TDD-strict mode) — context7 is mandatory this turn.
|
|
132
|
-
- `preferred` (default) — context7 is encouraged but not forced.
|
|
133
|
-
- `optional` (relaxed mode) — context7 is a nice-to-have.
|
|
134
|
-
- **Docs nudge** — If context7 is not installed and the model uses WebFetch on a documentation URL (docs.*, readthedocs, MDN, npmjs, pypi, crates.io, pkg.go.dev, etc.), vibeOS logs a one-time install suggestion and tracks the missed savings.
|
|
135
|
-
- **Savings tracking** — Every docs URL fetched via WebFetch instead of context7 is recorded as `missed_context7_usd` in `~/.claude/delegation-state.json`. Accumulated misses appear in `trinity project` analytics with an installation suggestion when bypasses exceed 3.
|
|
109
|
+
## Configuration
|
|
136
110
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
export CLAUDE_CONTEXT7_AVAILABLE=true
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Use this when context7 is configured but the auto-scan misses it (unusual paths, remote configs, or runtime-loaded MCP definitions).
|
|
144
|
-
|
|
145
|
-
## Environment Variables
|
|
146
|
-
|
|
147
|
-
| Variable | Default | Description |
|
|
111
|
+
| Variable | Default | Purpose |
|
|
148
112
|
|---|---|---|
|
|
149
|
-
| `VIBEOS_API_URL` | `https://api.vibetheog.com` | API server URL |
|
|
150
|
-
| `VIBEOS_API_TOKEN` |
|
|
113
|
+
| `VIBEOS_API_URL` | `https://api.vibetheog.com` | Remote API server URL |
|
|
114
|
+
| `VIBEOS_API_TOKEN` | none | Token for remote mode |
|
|
151
115
|
| `VIBEOS_API_ENABLED` | `true` | Set to `false` for local-only mode |
|
|
152
|
-
| `CLAUDE_CREDIT_PERCENT` | `100` | Credit
|
|
153
|
-
| `CLAUDE_CONTEXT7_AVAILABLE` |
|
|
116
|
+
| `CLAUDE_CREDIT_PERCENT` | `100` | Credit override |
|
|
117
|
+
| `CLAUDE_CONTEXT7_AVAILABLE` | unset | Enables context7 optimization |
|
|
154
118
|
| `CLAUDE_SCRATCHPAD_MAX_AGE_SEC` | `86400` | Scratchpad cache lifetime |
|
|
155
119
|
| `VIBEOS_MCP_PORT` | `3001` | MCP server port |
|
|
156
120
|
|
|
157
|
-
Without
|
|
158
|
-
|
|
159
|
-
## Runtime Model Slots
|
|
160
|
-
|
|
161
|
-
Tier configuration in `~/.claude/model-tiers.json`:
|
|
121
|
+
Without a token, vibeOS keeps running in local-only mode with bundled algorithms.
|
|
162
122
|
|
|
163
|
-
|
|
164
|
-
|---|---|
|
|
165
|
-
| `brain` | High-tier model for orchestration |
|
|
166
|
-
| `medium` | Mid-tier for moderate tasks |
|
|
167
|
-
| `cheap` | Low-tier for delegation subagents |
|
|
123
|
+
## Troubleshooting
|
|
168
124
|
|
|
169
|
-
|
|
125
|
+
- If the plugin does not appear, confirm the OpenCode config entry, then restart OpenCode Desktop.
|
|
126
|
+
- If the model will not switch, run `trinity rebuild` and then `trinity set brain|medium|cheap`.
|
|
127
|
+
- If writes or edits are blocked, that is usually delegation enforcement working as intended on the brain tier.
|
|
128
|
+
- If the footer is missing, check that the plugin is enabled and that the current OpenCode session is receiving assistant completions.
|
|
129
|
+
- If the remote API is down or the token is invalid, use `trinity api-token <token>` or rely on local-only mode.
|
|
130
|
+
- If the dashboard does not load, rebuild it from the backend root with `npm run build:dashboard`.
|
|
131
|
+
- If state or config looks inconsistent, run `trinity diagnose` and `trinity guard`.
|
|
170
132
|
|
|
171
|
-
##
|
|
133
|
+
## Notes
|
|
172
134
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
135
|
+
- `trinity help` is the canonical command reference.
|
|
136
|
+
- `../vibeOScore` is the backend sibling directory on the Desktop.
|
|
137
|
+
- The README stays intentionally high level so the command details can follow the code without a rewrite.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeostheog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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
|
"checkpoint:validate": "node scripts/checkpoint-validate.mjs",
|
|
14
14
|
"test:scripts": "node --test scripts/tests/checkpoint-validate.test.mjs",
|
|
15
15
|
"ts:audit": "node scripts/ts-audit.mjs",
|
|
16
|
-
"test": "VIBEOS_MCP_PORT=0 node --test --test-timeout=
|
|
16
|
+
"test": "VIBEOS_MCP_PORT=0 node --test --test-timeout=240000 tests/deep_integration.test.mjs tests/production_regressions.test.mjs tests/release_hardening_tigerteam.test.mjs tests/test_api_migration.neutral.test.mjs tests/test_const_assignment_regression.test.mjs tests/test_delegation_enforcer.test.mjs tests/test_diagnose_cmd.test.mjs tests/test_install_and_recovery.test.mjs tests/test_internals_stress_patterns_offtopic.test.mjs tests/test_saveos_e2e_cleanup.test.mjs tests/test_tdd_enforcer.test.mjs src/tests/*.test.js src/utils/tests/*.test.mjs \"src/vibeOS-lib/tests/!(test_blackbox*).test.mjs\"",
|
|
17
17
|
"test:ci": "VIBEOS_MCP_PORT=0 node --test --test-timeout=30000 tests/production_regressions.test.mjs tests/release_hardening_tigerteam.test.mjs tests/test_const_assignment_regression.test.mjs tests/test_diagnose_cmd.test.mjs tests/test_install_and_recovery.test.mjs tests/test_saveos_e2e_cleanup.test.mjs tests/test_tdd_enforcer.test.mjs src/tests/*.test.js src/utils/tests/*.test.mjs \"src/vibeOS-lib/tests/!(test_blackbox*).test.mjs\"",
|
|
18
18
|
"codex:guard": "bash plugins/vibetheog-codex/scripts/run-guard.sh",
|
|
19
19
|
"codex:guard:full": "VIBETHEOG_GUARD_FULL=1 bash plugins/vibetheog-codex/scripts/run-guard.sh",
|
package/scripts/deploy.mjs
CHANGED
|
@@ -70,11 +70,15 @@ try {
|
|
|
70
70
|
|
|
71
71
|
const envSrc = join(ROOT, ".env.production")
|
|
72
72
|
if (existsSync(envSrc)) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
const envContent = readFileSync(envSrc)
|
|
74
|
+
const pluginEnvDest = join(pluginDir, ".env.production")
|
|
75
|
+
const homeEnvDir = join(homedir(), ".claude")
|
|
76
|
+
const homeEnvDest = join(homeEnvDir, ".env.production")
|
|
77
|
+
|
|
78
|
+
mkdirSync(homeEnvDir, { recursive: true })
|
|
79
|
+
writeFileSync(pluginEnvDest, envContent)
|
|
80
|
+
writeFileSync(homeEnvDest, envContent)
|
|
81
|
+
process.stderr.write(`[vibeOS deploy] Synced .env.production to plugin dir and ~/.claude\n`)
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
// ── Install nightly pricing sync cron if not already present ──
|