holomime 3.5.0 → 3.5.1
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/dist/cli.js +84 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ var VERSION, LOGO, holomimeGradient;
|
|
|
31
31
|
var init_branding = __esm({
|
|
32
32
|
"src/ui/branding.ts"() {
|
|
33
33
|
"use strict";
|
|
34
|
-
VERSION = "3.5.
|
|
34
|
+
VERSION = "3.5.1";
|
|
35
35
|
LOGO = ` _ _ _
|
|
36
36
|
| |__ ___ | | ___ _ __ (_)_ __ ___ ___
|
|
37
37
|
| '_ \\ / _ \\| |/ _ \\| '_ \\| | '_ \` _ \\ / _ \\
|
|
@@ -22072,7 +22072,7 @@ init_config();
|
|
|
22072
22072
|
// src/commands/mira-cmd.ts
|
|
22073
22073
|
init_branding();
|
|
22074
22074
|
import chalk50 from "chalk";
|
|
22075
|
-
import { writeFileSync as writeFileSync41, readFileSync as readFileSync49, mkdirSync as mkdirSync29, existsSync as existsSync46 } from "fs";
|
|
22075
|
+
import { writeFileSync as writeFileSync41, readFileSync as readFileSync49, mkdirSync as mkdirSync29, existsSync as existsSync46, appendFileSync as appendFileSync3 } from "fs";
|
|
22076
22076
|
import { resolve as resolve56, join as join42 } from "path";
|
|
22077
22077
|
|
|
22078
22078
|
// src/analysis/ego-tracker.ts
|
|
@@ -22246,6 +22246,25 @@ function getShadowLogPath() {
|
|
|
22246
22246
|
function getEgoStatePath() {
|
|
22247
22247
|
return resolve56(process.cwd(), HOLOMIME_DIR4, "ego-state.json");
|
|
22248
22248
|
}
|
|
22249
|
+
function getBenchmarkHistoryPath() {
|
|
22250
|
+
return resolve56(process.cwd(), HOLOMIME_DIR4, "benchmark-history.jsonl");
|
|
22251
|
+
}
|
|
22252
|
+
function appendBenchmarkEntry(entry) {
|
|
22253
|
+
const dir = resolve56(process.cwd(), HOLOMIME_DIR4);
|
|
22254
|
+
mkdirSync29(dir, { recursive: true });
|
|
22255
|
+
appendFileSync3(getBenchmarkHistoryPath(), JSON.stringify(entry) + "\n");
|
|
22256
|
+
}
|
|
22257
|
+
function loadBenchmarkHistory() {
|
|
22258
|
+
const path = getBenchmarkHistoryPath();
|
|
22259
|
+
if (!existsSync46(path)) return [];
|
|
22260
|
+
try {
|
|
22261
|
+
const content = readFileSync49(path, "utf-8").trim();
|
|
22262
|
+
if (!content) return [];
|
|
22263
|
+
return content.split("\n").map((line) => JSON.parse(line));
|
|
22264
|
+
} catch {
|
|
22265
|
+
return [];
|
|
22266
|
+
}
|
|
22267
|
+
}
|
|
22249
22268
|
function loadTherapyState() {
|
|
22250
22269
|
const path = getTherapyStatePath();
|
|
22251
22270
|
if (!existsSync46(path)) return null;
|
|
@@ -22366,11 +22385,26 @@ async function therapyStart(options) {
|
|
|
22366
22385
|
console.log();
|
|
22367
22386
|
const scenarios = getBenchmarkScenarios();
|
|
22368
22387
|
let cycleCount = 0;
|
|
22388
|
+
let totalViolationsCaught = 0;
|
|
22389
|
+
let totalViolationsPassed = 0;
|
|
22369
22390
|
const runCycle = async () => {
|
|
22370
22391
|
if (cycleCount >= maxCycles) {
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22392
|
+
const now = /* @__PURE__ */ new Date();
|
|
22393
|
+
const tomorrow = new Date(now);
|
|
22394
|
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
22395
|
+
tomorrow.setHours(0, 0, 0, 0);
|
|
22396
|
+
const sleepMs = tomorrow.getTime() - now.getTime();
|
|
22397
|
+
const sleepHours = (sleepMs / 36e5).toFixed(1);
|
|
22398
|
+
console.log(
|
|
22399
|
+
chalk50.dim(` [${now.toLocaleTimeString()}] `) + chalk50.yellow(`Daily limit reached (${maxCycles} cycles). Sleeping ${sleepHours}h until midnight.`) + chalk50.dim(` Total DPO pairs: ${state.dpoPairsGenerated}`)
|
|
22400
|
+
);
|
|
22401
|
+
cycleCount = 0;
|
|
22402
|
+
totalViolationsCaught = 0;
|
|
22403
|
+
totalViolationsPassed = 0;
|
|
22404
|
+
await new Promise((resolve57) => setTimeout(resolve57, sleepMs));
|
|
22405
|
+
console.log(
|
|
22406
|
+
chalk50.dim(` [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] `) + chalk50.green("New day started. Resuming therapy cycles.")
|
|
22407
|
+
);
|
|
22374
22408
|
return;
|
|
22375
22409
|
}
|
|
22376
22410
|
cycleCount++;
|
|
@@ -22406,7 +22440,6 @@ async function therapyStart(options) {
|
|
|
22406
22440
|
}));
|
|
22407
22441
|
const corpusPath = resolve56(process.cwd(), HOLOMIME_DIR4, "dpo-corpus.jsonl");
|
|
22408
22442
|
const corpusLines = dpoPairs.map((p) => JSON.stringify(p)).join("\n") + "\n";
|
|
22409
|
-
const { appendFileSync: appendFileSync3 } = await import("fs");
|
|
22410
22443
|
appendFileSync3(corpusPath, corpusLines);
|
|
22411
22444
|
const pattern = scenario.targetPattern;
|
|
22412
22445
|
const existing = shadow.detected_patterns.find((p) => p.name === pattern);
|
|
@@ -22436,6 +22469,11 @@ async function therapyStart(options) {
|
|
|
22436
22469
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
22437
22470
|
});
|
|
22438
22471
|
saveShadowLog(shadow);
|
|
22472
|
+
if (therapyResult === "improved") {
|
|
22473
|
+
totalViolationsCaught += dpoPairs.length;
|
|
22474
|
+
} else {
|
|
22475
|
+
totalViolationsPassed += dpoPairs.length;
|
|
22476
|
+
}
|
|
22439
22477
|
egoTracker.logDecision({
|
|
22440
22478
|
situation: `therapy-cycle-${cycleCount}: ${pattern}`,
|
|
22441
22479
|
decision: "modified",
|
|
@@ -22460,6 +22498,21 @@ async function therapyStart(options) {
|
|
|
22460
22498
|
chalk50.dim(` [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] `) + chalk50.magenta(`Ego self-adjustment: ${adjustments.map((a) => `${a.parameter} \u2192 ${a.suggestedValue}`).join(", ")}`)
|
|
22461
22499
|
);
|
|
22462
22500
|
}
|
|
22501
|
+
const totalActions = totalViolationsCaught + totalViolationsPassed;
|
|
22502
|
+
const reliabilityScore = totalActions > 0 ? totalViolationsCaught / totalActions : 0;
|
|
22503
|
+
const entry = {
|
|
22504
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
22505
|
+
cycle: cycleCount,
|
|
22506
|
+
reliability_score: Math.round(reliabilityScore * 1e4) / 1e4,
|
|
22507
|
+
violations_caught: totalViolationsCaught,
|
|
22508
|
+
violations_passed: totalViolationsPassed,
|
|
22509
|
+
shadow_patterns: shadow.detected_patterns.length,
|
|
22510
|
+
ego_adjustments: state.egoAdjustments + adjustmentCount
|
|
22511
|
+
};
|
|
22512
|
+
appendBenchmarkEntry(entry);
|
|
22513
|
+
console.log(
|
|
22514
|
+
chalk50.dim(` [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] `) + chalk50.cyan(`Reliability: ${(reliabilityScore * 100).toFixed(1)}%`) + chalk50.dim(` (caught: ${totalViolationsCaught}, passed: ${totalViolationsPassed})`)
|
|
22515
|
+
);
|
|
22463
22516
|
}
|
|
22464
22517
|
saveEgoTracker(egoTracker);
|
|
22465
22518
|
state.cyclesCompleted = cycleCount;
|
|
@@ -22558,6 +22611,31 @@ function therapyStatus() {
|
|
|
22558
22611
|
console.log(chalk50.dim(" Best strat: ") + chalk50.cyan(egoStats.mostEffectiveStrategy));
|
|
22559
22612
|
}
|
|
22560
22613
|
}
|
|
22614
|
+
const benchmarkHistory = loadBenchmarkHistory();
|
|
22615
|
+
if (benchmarkHistory.length > 0) {
|
|
22616
|
+
console.log();
|
|
22617
|
+
console.log(chalk50.dim(" Reliability trend:"));
|
|
22618
|
+
const scores = benchmarkHistory.map((e) => e.reliability_score);
|
|
22619
|
+
const scoreLabels = scores.map((s) => `${(s * 100).toFixed(1)}%`);
|
|
22620
|
+
const display = scoreLabels.length <= 5 ? scoreLabels.join(" \u2192 ") : [...scoreLabels.slice(0, 2), "...", ...scoreLabels.slice(-2)].join(" \u2192 ");
|
|
22621
|
+
let trendLabel;
|
|
22622
|
+
if (scores.length >= 2) {
|
|
22623
|
+
const first = scores[0];
|
|
22624
|
+
const last = scores[scores.length - 1];
|
|
22625
|
+
if (last > first + 0.01) {
|
|
22626
|
+
trendLabel = chalk50.green("(improving)");
|
|
22627
|
+
} else if (last < first - 0.01) {
|
|
22628
|
+
trendLabel = chalk50.red("(declining)");
|
|
22629
|
+
} else {
|
|
22630
|
+
trendLabel = chalk50.dim("(stable)");
|
|
22631
|
+
}
|
|
22632
|
+
} else {
|
|
22633
|
+
trendLabel = chalk50.dim("(baseline)");
|
|
22634
|
+
}
|
|
22635
|
+
console.log(chalk50.dim(" Reliability: ") + chalk50.cyan(display) + " " + trendLabel);
|
|
22636
|
+
const latest = benchmarkHistory[benchmarkHistory.length - 1];
|
|
22637
|
+
console.log(chalk50.dim(" Last check: ") + chalk50.dim(`cycle ${latest.cycle}, ${new Date(latest.timestamp).toLocaleString()}`));
|
|
22638
|
+
}
|
|
22561
22639
|
console.log();
|
|
22562
22640
|
if (state.status === "practicing") {
|
|
22563
22641
|
console.log(chalk50.dim(" Run ") + chalk50.cyan("holomime therapy stop") + chalk50.dim(" to stop therapy."));
|