vibeostheog 0.23.22 → 0.23.24

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,3 +1,11 @@
1
+ ## 0.23.24
2
+ - fix: ML-driven tier pipeline end-to-end
3
+
4
+
5
+ ## 0.23.23
6
+ - fix: apiComputeControlVector overrides server tier_bias with local regime-driven value
7
+
8
+
1
9
  ## 0.23.22
2
10
  - fix: whitespace in vector_changed indicator (→ cheap)
3
11
  v0.23.21: Split saveOptimizationMode try-catch — global save survives session write failures
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.23.22",
3
+ "version": "0.23.24",
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",
@@ -47,8 +47,10 @@ const correctionSeenKeys = new Set();
47
47
  async function apiComputeControlVector(state, action, optimizationMode) {
48
48
  try {
49
49
  const res = await remoteCall("blackboxControlVector", [state, action, optimizationMode], null);
50
- if (res?.control_vector)
51
- return res.control_vector;
50
+ if (res?.control_vector) {
51
+ const local = computeControlVector(state, action, optimizationMode);
52
+ return { ...res.control_vector, tier_bias: local.tier_bias };
53
+ }
52
54
  }
53
55
  catch { }
54
56
  return computeControlVector(state, action, optimizationMode);
@@ -217,7 +219,7 @@ export function syncControlSettings(cv, options = {}) {
217
219
  writeSessionSlot(sid, slot);
218
220
  writeIf("vector_changed_slot", slot);
219
221
  writeIf("vector_changed_at", Date.now());
220
- const applied = applySlot(slot);
222
+ const applied = applySlot(slot, onSystemTransform._directory || "");
221
223
  if (!applied?.ok) {
222
224
  console.error(`[vibeOS] failed to apply slot ${slot}: ${applied?.reason || "unknown"}`);
223
225
  }
@@ -1229,7 +1229,7 @@ export function _refreshModel(directory) {
1229
1229
  }
1230
1230
  catch { }
1231
1231
  }
1232
- export function applySlot(slot) {
1232
+ export function applySlot(slot, projectDir = "") {
1233
1233
  try {
1234
1234
  const TIERS_FILE = join(getVibeOSHome(), "model-tiers.json");
1235
1235
  const j = safeJsonParse(readFileSync(TIERS_FILE, "utf-8"));
@@ -1237,11 +1237,11 @@ export function applySlot(slot) {
1237
1237
  if (!ocModel)
1238
1238
  return { ok: false, reason: `slot '${slot}' has no oc model` };
1239
1239
  j.selection.active_slot = slot;
1240
- const _tmp = TIERS_FILE + ".tmp." + Date.now();
1240
+ const _tmp = TIERS_FILE + ".tmp." + Date.now() + "." + Math.random().toString(36).slice(2, 8);
1241
1241
  writeFileSync(_tmp, JSON.stringify(j, null, 2) + "\n", "utf-8");
1242
1242
  renameSync(_tmp, TIERS_FILE);
1243
- // Prefer project-local config to avoid mutating global provider/dropdown config.
1244
- const localOcConfig = join(process.cwd(), "opencode.json");
1243
+ const dir = projectDir || process.cwd();
1244
+ const localOcConfig = join(dir, "opencode.json");
1245
1245
  const ocConfig = existsSync(localOcConfig)
1246
1246
  ? localOcConfig
1247
1247
  : join(getOpenCodeHome(), "opencode.json");
@@ -87,7 +87,7 @@ export function writeSelection(key, value) {
87
87
  if (!j.selection)
88
88
  j.selection = {};
89
89
  j.selection[key] = value;
90
- const tmp = TIERS_FILE + ".tmp";
90
+ const tmp = TIERS_FILE + ".tmp." + Date.now() + "." + Math.random().toString(36).slice(2, 8);
91
91
  writeFileSync(tmp, JSON.stringify(j, null, 2) + "\n");
92
92
  renameSync(tmp, TIERS_FILE);
93
93
  return true;