Skip to content

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
804 B
Raw Blame
import { expect, test } from "bun:test";

import { resolveSearchRequest } from "../../../src/core/search/pipeline/request.ts";
import { makeConfig } from "../../helpers/search-fixtures.ts";

const config = makeConfig({ vault: "vault", dbPath: "vault/.open-second-brain/brain.sqlite" });

test.each(["../up", "/etc", "C:/Users", "c:\\Users", "D:notes"])(
  "a path_prefix outside the vault is refused at query time (%p)",
  (pathPrefix) => {
    expect(() => resolveSearchRequest(config, { query: "fox", pathPrefix })).toThrow(
      "path_prefix escapes vault",
    );
  },
);

test.each(["Notes/", "Projects/C:x", "c-notes/"])(
  "a vault-relative path_prefix is kept (%p)",
  (pathPrefix) => {
    expect(resolveSearchRequest(config, { query: "fox", pathPrefix }).pathPrefix).toBe(pathPrefix);
  },
);