vibeostheog 0.24.10 → 0.24.12

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,9 +1,15 @@
1
- ## 0.24.10
2
- - fix: wire npm auth for GitHub releases
3
-
4
-
5
- ## 0.24.9
6
- - fix: preserve live metrics context in reports
1
+ ## 0.24.12
2
+ - feat: smooth delegation UX conversational reasoning over error injection
3
+ - fix: write npm auth for github release publish
4
+ - fix: reset api fallback on token refresh (#138)
5
+ - fix: _prevBlackboxState -> _latestBlackboxState, update pattern key test
6
+ - fix: sync-ts-build was cleaning JS artifacts without copying compiled output back
7
+ - fix: forensic anti-lying + quality enforcement pipeline
8
+ - docs: add cross-project index, DEV ONLY markers, ESLint cleanup
9
+ - test: add 13 cascade integration tests for forensic quality pipeline
10
+ - chore: sync package version to latest github release
11
+ - chore: sync package version to latest release
12
+ Merge pull request #136 from DrunkkToys/release/v0.24.8-merge
7
13
 
8
14
 
9
15
  ## 0.24.5
package/dist/vibeOS.js CHANGED
@@ -1596,7 +1596,7 @@ import { dirname as dirname3 } from "node:path";
1596
1596
  import { fileURLToPath as fileURLToPath3 } from "node:url";
1597
1597
  import { homedir } from "node:os";
1598
1598
 
1599
- // src/lib/runtime-state.ts
1599
+ // src/lib/runtime-state.js
1600
1600
  var RUNTIME_KEY = "__vibeOSRuntimeState";
1601
1601
  function getRuntimeState() {
1602
1602
  const g = globalThis;
@@ -1623,7 +1623,8 @@ function markApiDisconnected() {
1623
1623
  const state = getRuntimeState();
1624
1624
  state.apiConnected = false;
1625
1625
  state.apiFallbackMode = true;
1626
- if (!state.apiFallbackSince) state.apiFallbackSince = (/* @__PURE__ */ new Date()).toISOString();
1626
+ if (!state.apiFallbackSince)
1627
+ state.apiFallbackSince = (/* @__PURE__ */ new Date()).toISOString();
1627
1628
  }
1628
1629
  function resetApiConnection() {
1629
1630
  const state = getRuntimeState();
@@ -2151,9 +2152,13 @@ function setApiToken(newToken) {
2151
2152
  VIBEOS_API_TOKEN = normalizeApiToken(newToken, EMBEDDED_API_TOKEN);
2152
2153
  VIBEOS_API_BOOTSTRAP_TOKEN = readBootstrapTokenFromDisk() || VIBEOS_API_BOOTSTRAP_TOKEN;
2153
2154
  VIBEOS_API_ENABLED = process.env.VIBEOS_API_ENABLED !== "false" && (!!VIBEOS_API_TOKEN || !!VIBEOS_API_BOOTSTRAP_TOKEN);
2155
+ _apiClient = null;
2156
+ _apiFallbackMode = false;
2157
+ _apiFallbackSince = null;
2154
2158
  persistPrimaryApiEnvState({ token: VIBEOS_API_TOKEN, disabled: false });
2155
2159
  if (_anomalyDetector)
2156
2160
  _anomalyDetector.reset();
2161
+ resetApiConnection();
2157
2162
  console.error("[vibeOS] API token updated via setApiToken");
2158
2163
  } catch (e) {
2159
2164
  console.error("[vibeOS] Failed to update API token:", e.message);
@@ -7332,6 +7337,7 @@ function getReportsIndexPath() {
7332
7337
  }
7333
7338
  var REPORTS_DIR2 = getReportsDir();
7334
7339
  var REPORTS_INDEX = getReportsIndexPath();
7340
+ var _OC_SID3 = "opencode-" + (process.pid || "x") + "-" + Date.now();
7335
7341
  var currentProjectFingerprint2 = "";
7336
7342
  var currentProjectName2 = "";
7337
7343
  function _handleStateCorruption4(path) {
@@ -7464,22 +7470,12 @@ function _parseMetrics(v) {
7464
7470
  function saveReport({ type = "manual", summary = "", findings = null, metrics = null, narrative = "", tags = [], fingerprint = null, status = "pending", task_description = "", outcome_verified = false } = {}) {
7465
7471
  const parsedFindings = _parseFindings(findings);
7466
7472
  const parsedMetrics = _parseMetrics(metrics);
7467
- const metricsObject = parsedMetrics && typeof parsedMetrics === "object" && !Array.isArray(parsedMetrics) ? parsedMetrics : {};
7468
- const metricsSessionId = typeof metricsObject.sessionId === "string" && metricsObject.sessionId.trim() ? metricsObject.sessionId.trim() : "";
7469
- const metricsProjectName = typeof metricsObject.projectName === "string" && metricsObject.projectName.trim() ? metricsObject.projectName.trim() : "";
7470
- const metricsProjectFingerprint = typeof metricsObject.projectFingerprint === "string" && metricsObject.projectFingerprint.trim() ? metricsObject.projectFingerprint.trim() : "";
7471
7473
  if (_wouldBeDuplicate(type, summary))
7472
7474
  return null;
7473
- if (!currentProjectFingerprint2 && metricsProjectFingerprint)
7474
- currentProjectFingerprint2 = metricsProjectFingerprint;
7475
- if (!currentProjectName2 && metricsProjectName)
7476
- currentProjectName2 = metricsProjectName;
7477
- const fp2 = fingerprint || metricsProjectFingerprint || currentProjectFingerprint2 || "unknown";
7478
- const sessionId = metricsSessionId || getOcSessionId();
7479
- const projectName = metricsProjectName || currentProjectName2 || "unknown";
7475
+ const fp2 = fingerprint || currentProjectFingerprint2 || "unknown";
7480
7476
  const id2 = generateReportId(type, fp2);
7481
7477
  const report = {
7482
- meta: { id: id2, project: projectName, fingerprint: fp2, type, created: (/* @__PURE__ */ new Date()).toISOString(), sessionId },
7478
+ meta: { id: id2, project: currentProjectName2 || "unknown", fingerprint: fp2, type, created: (/* @__PURE__ */ new Date()).toISOString(), sessionId: _OC_SID3 },
7483
7479
  summary,
7484
7480
  findings: parsedFindings,
7485
7481
  metrics: parsedMetrics,
@@ -10145,7 +10141,7 @@ function ensureProjectContext(hookDirectory) {
10145
10141
  return resolved;
10146
10142
  }
10147
10143
  var latestUserIntent = null;
10148
- var _OC_SID3 = "opencode-" + (process.pid || "x") + "-" + Date.now();
10144
+ var _OC_SID4 = "opencode-" + (process.pid || "x") + "-" + Date.now();
10149
10145
  var _latestBlackboxState3 = null;
10150
10146
  var _latestBlackboxLoopMsg3 = null;
10151
10147
  var _latestBlackboxPivotMsg3 = null;
@@ -10287,7 +10283,7 @@ function syncControlSettings(cv, options = {}) {
10287
10283
  if (!cv)
10288
10284
  return;
10289
10285
  try {
10290
- const sid = _OC_SID3;
10286
+ const sid = _OC_SID4;
10291
10287
  if (!cv.agent_mode) {
10292
10288
  try {
10293
10289
  clearWorkspaceFollowupPauseForSession(sid);
@@ -10507,7 +10503,7 @@ async function trackBlackbox(messages) {
10507
10503
  const tracker = getBlackboxTracker();
10508
10504
  const localState = tracker.update(latestUserIntent);
10509
10505
  const state = loadBlackboxState();
10510
- const sid = _OC_SID3;
10506
+ const sid = _OC_SID4;
10511
10507
  ensureProjectContext(process.cwd() || "");
10512
10508
  const serialized = tracker.serialize();
10513
10509
  const existingSession = state.sessions[sid] || {};
@@ -10835,7 +10831,7 @@ var onSystemTransform = async (_input, output) => {
10835
10831
  const regime2 = _latestBlackboxState3?.sub_regime || classifyTurnSimple2(latestUserIntent || "");
10836
10832
  const calRecord = JSON.stringify({
10837
10833
  ts: (/* @__PURE__ */ new Date()).toISOString(),
10838
- sid: _OC_SID3,
10834
+ sid: _OC_SID4,
10839
10835
  mode: _currentTemplate,
10840
10836
  regime: regime2,
10841
10837
  stress: stressScore,
@@ -11002,7 +10998,7 @@ function readLifetimeSavings2() {
11002
10998
  reconcileStateFromLedger();
11003
10999
  const raw = readFileSync14(STATE_FILE2, "utf-8");
11004
11000
  const state = safeJsonParse3(raw);
11005
- const ses = state?.sessions?.[typeof _OC_SID4 !== "undefined" ? _OC_SID4 : ""] || {};
11001
+ const ses = state?.sessions?.[typeof _OC_SID5 !== "undefined" ? _OC_SID5 : ""] || {};
11006
11002
  return {
11007
11003
  ltTasks: roundUsd2(state?.lifetime?.total_savings_usd || 0),
11008
11004
  ltCache: roundUsd2(state?.lifetime?.cache_savings_usd || 0),
@@ -11030,7 +11026,7 @@ function readLifetimeSavings2() {
11030
11026
  return { ltTasks: 0, ltCache: 0, ltCost: 0, count: 0, sesTasks: 0, sesCache: 0, sesTaskDelegations: 0, sesDuration: 0, sesRatePerHour: 0, sesTrend: "", sesToolBreakdown: {}, sesModelTurns: {}, quality_avg: 0 };
11031
11027
  }
11032
11028
  }
11033
- var _OC_SID4 = "opencode-" + (process.pid || "x") + "-" + Date.now();
11029
+ var _OC_SID5 = "opencode-" + (process.pid || "x") + "-" + Date.now();
11034
11030
  function scoreTaskQuality(outputText, promptText) {
11035
11031
  if (typeof outputText !== "string" || outputText.length === 0)
11036
11032
  return 0;
@@ -11057,7 +11053,7 @@ function scoreTaskQuality(outputText, promptText) {
11057
11053
  function readRewardSignals() {
11058
11054
  try {
11059
11055
  const state = loadBlackboxState();
11060
- const session = state?.sessions?.[_OC_SID4] || {};
11056
+ const session = state?.sessions?.[_OC_SID5] || {};
11061
11057
  const policy = session?.mode_policy || {};
11062
11058
  return {
11063
11059
  stableStreak: Math.max(0, Number(policy.stable_streak || 0)),
@@ -11134,7 +11130,7 @@ async function _appendFooter(input, output, directory3) {
11134
11130
  return;
11135
11131
  const { ltTasks, ltCache, ltCost, count, sesTasks, sesEdit, sesCredit, sesC7, sesQuota, sesCache, sesTaskDelegations, sesDuration, sesRatePerHour, sesTrend, sesToolBreakdown, sesModelTurns, quality_avg } = readLifetimeSavings2();
11136
11132
  const { stableStreak, problemStreak } = readRewardSignals();
11137
- const sessionSlot = loadBlackboxState()?.sessions?.[_OC_SID4]?.active_slot || loadSessionSlot(_OC_SID4);
11133
+ const sessionSlot = loadBlackboxState()?.sessions?.[_OC_SID5]?.active_slot || loadSessionSlot(_OC_SID5);
11138
11134
  const slot = sessionSlot || loadSelection3().active_slot || "brain";
11139
11135
  const brainModel = slot === "brain" ? TRINITY_BRAIN || currentModel : slot === "medium" ? TRINITY_MEDIUM || currentModel : TRINITY_CHEAP || currentModel || "";
11140
11136
  let liveModel = "";
@@ -11168,7 +11164,7 @@ async function _appendFooter(input, output, directory3) {
11168
11164
  type: "session",
11169
11165
  summary: "Session cost: $" + formatUsd(ltCost) + " | cache saved: $" + formatUsd(ltCache) + " | delegation saved: $" + formatUsd(Number(sesTasks || 0)) + " | task delegations: " + Number(sesTaskDelegations || 0),
11170
11166
  metrics: {
11171
- sessionId: _OC_SID4,
11167
+ sessionId: _OC_SID5,
11172
11168
  projectFingerprint: currentProjectFingerprint || "unknown",
11173
11169
  projectName: currentProjectName || "unknown",
11174
11170
  sessionCost: ltCost,
@@ -11257,7 +11253,7 @@ ${vibeLine}`;
11257
11253
  syncOutcomeToApi(finalOutcome);
11258
11254
  try {
11259
11255
  mkdirSync11(getVibeOSHome10(), { recursive: true });
11260
- appendFileSync6(join15(getVibeOSHome10(), "calibration-data.jsonl"), JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), event: "outcome", sid: _OC_SID4, outcome: finalOutcome }) + "\n");
11256
+ appendFileSync6(join15(getVibeOSHome10(), "calibration-data.jsonl"), JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), event: "outcome", sid: _OC_SID5, outcome: finalOutcome }) + "\n");
11261
11257
  } catch {
11262
11258
  }
11263
11259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.24.10",
3
+ "version": "0.24.12",
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",