chore: drop hive-mind provenance notes from comments (P2.2)

Comments that pointed at hive-mind-core files, the hive-mind OSS
mirror and its drift triage now describe the code as it is. The
in-process reranker caches its model in ~/.waggle/models, like the
embedder, when the caller passes no directory; the sidecar always
passes one.
This commit is contained in:
shumeiko.it
2026-11-01 00:42:48 +01:00
parent 613b23be17
commit c098f20872
20 changed files with 30 additions and 73 deletions

View File

@@ -109,7 +109,6 @@ function createMockEmbedder(dims: number): Embedder {
}
// ── Embed-input guards (oversized-frame truncation + skip-not-abort) ──
// Reverse-ported from OSS hive-mind (oss-drift triage R5, 2026-06-11).
/**
* Per-input character cap for embedding. `nomic-embed-text` has a 2048-token
@@ -334,7 +333,6 @@ export async function createEmbeddingProvider(config?: EmbeddingProviderConfig):
// most dangerous failure mode in Phase 3b-3 audit. Mock embeddings
// are deterministic byte hashes; semantic search returns noise.
// We want this to be IMPOSSIBLE to miss in a CLI/server log.
// Ported from hive-mind a99ea0e.
const msg = [
'',
'⚠️ EMBEDDING WARNING ─────────────────────────────────────────',
@@ -381,7 +379,7 @@ export async function createEmbeddingProvider(config?: EmbeddingProviderConfig):
async embed(text: string): Promise<Float32Array> {
// Cap input to the active model's context so the backend never rejects
// an oversized frame. Reverse-ported from OSS hive-mind (oss-drift triage R5, 2026-06-11).
// an oversized frame.
const capped = capEmbedText(text, maxEmbedCharsForModel(activeModelName));
try {
const result = await activeEmbedder.embed(capped);
@@ -399,8 +397,7 @@ export async function createEmbeddingProvider(config?: EmbeddingProviderConfig):
async embedBatch(texts: string[]): Promise<Float32Array[]> {
if (texts.length === 0) return [];
// Cap each input first so one oversized frame can't make the backend
// reject the whole request. Reverse-ported from OSS hive-mind
// (oss-drift triage R5, 2026-06-11).
// reject the whole request.
const capped = texts.map(t => capEmbedText(t, maxEmbedCharsForModel(activeModelName)));
try {
const result = await activeEmbedder.embedBatch(capped);

View File

@@ -5,7 +5,6 @@
* structured output (pino, winston, etc.) can wrap their logger in this
* shape and pass it as a dependency.
*/
// Reverse-ported from OSS hive-mind (oss-drift triage R1, 2026-06-11).
export interface CoreLogger {
info(msg: string, data?: unknown): void;
warn(msg: string, data?: unknown): void;
@@ -15,16 +14,15 @@ export interface CoreLogger {
export function createCoreLogger(tag: string): CoreLogger {
const prefix = `[waggle:${tag}]`;
// ALL diagnostics go to stderr. stdout is reserved for program data — the
// MCP stdio protocol (hive-mind-mcp-server) and CLI `--json` envelopes — so
// ALL diagnostics go to stderr. stdout is reserved for program data — MCP
// stdio protocols and CLI `--json` envelopes — so
// a library log line on stdout corrupts machine consumers. console.warn and
// console.error already target stderr; route info/debug there too rather
// than console.info/console.debug (which write to stdout).
// Reverse-ported from OSS hive-mind (oss-drift triage R1, 2026-06-11).
//
// Guard the optional payload with `data !== undefined` (NOT a truthiness
// check) so falsy-but-defined payloads (0, '', false, null) are still
// logged instead of silently dropped. Ported from hive-mind a99ea0e.
// logged instead of silently dropped.
return {
info: (msg: string, data?: unknown) =>
data !== undefined ? console.error(`${prefix} ${msg}`, data) : console.error(`${prefix} ${msg}`),

View File

@@ -53,7 +53,7 @@ export async function createInProcessReranker(
config?: Partial<InProcessRerankerConfig>,
): Promise<Reranker> {
const model = config?.model ?? 'Xenova/ms-marco-MiniLM-L-6-v2';
const cacheDir = config?.cacheDir ?? path.join(os.homedir(), '.hive-mind', 'models');
const cacheDir = config?.cacheDir ?? path.join(os.homedir(), '.waggle', 'models');
log.info(`Loading in-process reranker: ${model} (~22MB first download)`);

View File

@@ -12,7 +12,7 @@
* See benchmarks/results/memori-phase22-RESULT.md (Phase 4).
*
* This is the deterministic, dependency-free production counterpart of the benchmark's
* LLM extraction pass (hive-mind-test scripts/locomo/33-distill-episodic.mjs). It covers
* LLM extraction pass. It covers
* the dominant cue patterns the calibration surfaced ("yesterday", "last week", "N days
* ago", "last <weekday>", "last year") without a per-frame LLM call. Pure + side-effect
* free; the caller decides whether to use the resolved date.

View File

@@ -179,7 +179,6 @@ export class WorkspaceManager {
* with user-supplied names should still go through `create()` so the
* generateId collision logic runs.
*/
// Reverse-ported from OSS hive-mind (oss-drift triage R4, 2026-06-11).
ensure(id: string, options: Partial<CreateWorkspaceOptions> = {}): WorkspaceConfig {
this.assertWorkspaceId(id);
const existing = this.get(id);