Local-first 🧠memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.
TypeScript
import { describe, expect, test } from "bun:test";
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import {
buildComplexityReport,
complexityPathFactors,
} from "../../src/core/discipline/complexity.ts";
describe("complexity report", () => {
test("weights path-derived structure factors", () => {
const root = mkdtempSync(join(tmpdir(), "o2b-disc-complexity-"));
try {
mkdirSync(join(root, "notes", "deep", "templates"), { recursive: true });
writeFileSync(
join(root, "notes", "deep", "templates", "daily.md"),
"---\ntags: [workflow, review]\n---\n#brain/review\n",
);
writeFileSync(join(root, ".obsidian.json"), "{}\n");
const pathFactors = complexityPathFactors([
{ root, relativePath: "notes/deep/templates/daily.md" },
{ root, relativePath: ".obsidian.json" },
]);
const report = buildComplexityReport({
thinkingActivity: 1,
structuralFilesChanged: 2,
...pathFactors,
});
expect(report.factors).toContainEqual({
name: "max_folder_depth",
value: 3,
weight: 1,
});
expect(report.factors).toContainEqual({
name: "template_changes",
value: 1,
weight: 2,
});
expect(report.factors).toContainEqual({
name: "config_changes",
value: 1,
weight: 2,
});
expect(report.factors).toContainEqual({
name: "tag_proliferation",
value: 3,
weight: 1,
});
expect(report.warning).toBe(true);
} finally {
rmSync(root, { recursive: true, force: true });
}
});
});