refactor: drop the legacy memory engine from core, the server and the build (P1.5)

- @waggle/core no longer re-exports @waggle/hive-mind-core and no longer
  depends on it.
- The server no longer opens personal.mind or a cache of workspace minds;
  the legacy files are only read by the one-time copies of legacy data.
  releaseWorkspace closes the workspace's sessions and detaches it from the
  shared orchestrator.
- WorkspaceManager stops creating an empty workspace.mind.
- memory-center-legacy.ts had no callers left and is removed.
- build:packages no longer builds hive-mind-core and wiki-compiler; the
  sidecar aliases the memory packages to source instead.
- mem0ai stays external in the sidecar and launcher bundles: it imports a
  client for every provider it supports on demand, and bundling it failed on
  the optional peers Waggle does not install. The launcher declares mem0ai
  and no longer needs sqlite-vec.
This commit is contained in:
shumeiko.it
2026-10-24 13:34:09 +02:00
parent bde961abcf
commit e435e7da94
12 changed files with 252 additions and 190 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "@waggle/core",
"version": "0.1.0",
"description": "Waggle-specific orchestration: config, multi-mind, workspace, vault, telemetry, install-audit, cron, skills, file-store, file-indexer, memory-import. Re-exports substrate from @waggle/hive-mind-core for backward compatibility.",
"description": "Waggle infrastructure: config, workspaces, waggle.db stores, secrets, telemetry, file storage and indexing, embeddings and recall helpers.",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -17,7 +17,6 @@
},
"dependencies": {
"@huggingface/transformers": "^3.8.1",
"@waggle/hive-mind-core": "*",
"@waggle/memory-contract": "*",
"@waggle/shared": "*",
"better-sqlite3": "^12.6.2",

View File

@@ -1,23 +1,11 @@
// @waggle/core — Waggle-specific orchestration layer.
// @waggle/core — Waggle's own infrastructure: config, workspaces, waggle.db
// stores (automations, cost tracking, profile, awareness, install audit),
// secrets, telemetry, file storage and indexing, embeddings and recall helpers.
//
// As of CC Sesija B 2026-04-30 (PM Q3 Plan A ratification), the substrate
// (mind/ + harvest/ + logger + injection-scanner) lives in @waggle/hive-mind-core
// and is distributed as Apache 2.0 OSS through a reviewed, maintainer-curated
// forward-port. Raw subtree-split output is never a publication source. This
// barrel re-exports
// substrate symbols for backward compatibility — existing consumers (packages/agent,
// apps/web, packages/server, etc.) keep their `import { ... } from '@waggle/core'`
// imports unchanged.
//
// Waggle-specific (non-extracted) modules below the substrate re-exports stay
// in this package: config, multi-mind, workspace orchestration, vault, telemetry,
// install-audit, cron-store, skill-hashes, file-store, file-indexer,
// memory-import.
// Memory is not here: Waggle reaches it only through @waggle/memory-contract
// (ADR-0007).
// ── Waggle infrastructure (not memory) ──
// Copied from @waggle/hive-mind-core so the rest of Waggle no longer depends on
// the memory substrate for them (P1.5). The substrate keeps its own copies until
// the package is removed.
export { createCoreLogger, type CoreLogger } from './logger.js';
export { scanForInjection, type ScanResult } from './injection-scanner.js';
export {
@@ -66,80 +54,7 @@ export {
} from './execution-traces.js';
export { importLegacyMindData, type LegacyMindSource, type LegacyImportReport } from './waggle-db-import.js';
// ── Substrate re-exports from @waggle/hive-mind-core (Apache 2.0 OSS) ──
export {
// mind/ — memory substrate
MindDB, EmbeddingDimMismatchError,
type EmbeddingFingerprint, type FingerprintCheck,
FrameStore, stripHmPrefix, hashFrameContent,
RawArchive, hashRaw, readArchiveUids, withArchiveUid, type RawArchiveRow, type ArchiveInput,
MindErasure, type EraseResult,
SuppressionStore, type SuppressedSubject,
type MemoryFrame, type FrameType, type Importance, type FrameSource,
SessionStore, type Session,
HybridSearch, type SearchResult,
// D1 (oss-drift triage, 2026-06-11) — chunk-level retrieval (flag-gated, default OFF)
chunkRetrievalEnabled, rechunkAllFrames, type RechunkResult,
chunkText, type ChunkOptions, type FrameChunk,
KnowledgeGraph, type Entity, type Relation, type ValidationSchema,
SCHEMA_SQL, VEC_TABLE_SQL, CHUNKS_VEC_TABLE_SQL, SCHEMA_VERSION,
vecTableSqlForDim, chunksVecTableSqlForDim,
computeRelevance,
computeTemporalScore,
computePopularityScore,
computeContextualScore,
computeImportanceScore,
SCORING_PROFILES,
type ScoringProfile,
type ScoringWeights,
normalizeEntityName, findDuplicates, isNoiseName, isLikelyAcronym,
Ontology, validateEntity, type EntitySchema, type ValidationResult,
reconcileIndexes, reconcileFtsIndex, reconcileVecIndex, cleanOrphanVectors, cleanOrphanFts,
type ReconcileResult,
ConceptTracker, CONCEPT_MASTERY_TABLE_SQL,
type ConceptEntry, type ConceptUpdate,
// harvest/ — universal memory ingestion pipeline
HarvestSourceStore,
HarvestRunStore, type HarvestRun, type HarvestRunStatus,
ChatGPTAdapter,
ClaudeAdapter,
ClaudeCodeAdapter,
GeminiAdapter,
UniversalAdapter,
MarkdownAdapter,
PlaintextAdapter,
UrlAdapter,
PdfAdapter,
HarvestPipeline, type LLMCallFn, type PipelineOptions,
extractMemoryLanes, writeMemoryLaneFrames,
MIND_FACT_PREFIX, MIND_EVENT_PREFIX, MIND_PROFILE_PREFIX,
type MemoryLaneExtraction, type ExtractedEvent, type ExtractedFact, type ExtractedProfile,
type WriteLaneFramesResult,
// D2 — LLM-based KG entity extraction (oss-drift triage, 2026-06-11)
extractKgEntities, writeKgEntities, KG_ENTITY_TYPES,
type KgEntity, type KgEntityType, type KgEntityExtraction, type WriteKgEntitiesResult,
// W4.6 — raw-turn storage + RAWDETAIL recall lane
writeRawTurnFrames, rawTurnHeader, parseRawTurnHeader, rawTurnConvKey,
MIND_RAWTURN_PREFIX, MAX_TURNS_PER_ITEM, RAWDETAIL_KILL_SWITCH,
type WriteRawTurnsResult, type ParsedRawTurnHeader,
fetchRawDetailLane, rawTurnBody, RAW_DETAIL_K,
type RawTurnHit, type RawDetailLaneOptions,
dedup, harvestSetHash,
HARVEST_FRAME_CONTENT_CAP,
type ImportSourceType, type ImportItemType, type UniversalImportItem, type DistilledKnowledge,
type HarvestPipelineResult, type HarvestSource, type SourceAdapter, type FilesystemAdapter,
type ClassifiedItem, type ExtractedContent, type KnowledgeProvenance,
// Plan A AMENDMENT 2026-04-30 — multi-workspace orchestration
MultiMind, type MultiMindSearchResult, type MindSource, type SearchScope,
MultiMindCache, type MultiMindCacheConfig,
// Supersession (P) + bridge (B) frame producer (mono-parity 2026-07-05)
detectSupersessionChains, detectEntityGroups, applyConsolidation,
collectObservations, getCurrentValues,
type ConsolidationLlm, type Observation, type SupersessionChain,
type EntityGroup, type ConsolidationResult, type CollectObservationsOptions,
} from '@waggle/hive-mind-core';
// ── Waggle-specific orchestration (stays in @waggle/core) ──
// ── Waggle-specific orchestration ──
export { WaggleConfig, type ProviderEntry } from './config.js';
export { needsMigration, migrateToMultiMind } from './migration.js';
export {

View File

@@ -131,8 +131,8 @@ function isContained(root: string, candidate: string): boolean {
* WorkspaceManager manages workspace CRUD, groups, and directory structure.
* Each workspace lives under {baseDir}/workspaces/{id}/ with:
* - workspace.json (config)
* - workspace.mind (SQLite .mind file, created empty)
* - sessions/ (JSONL session logs)
* Workspace memory lives in the memory store, not in this directory.
*/
export class WorkspaceManager {
private readonly workspacesDir: string;
@@ -217,9 +217,6 @@ export class WorkspaceManager {
}
fs.mkdirSync(path.join(canonicalWorkspace, 'sessions'));
// Touch workspace.mind — MindDB will init schema when first opened
fs.writeFileSync(path.join(canonicalWorkspace, 'workspace.mind'), '', { flag: 'wx' });
const config: WorkspaceConfig = {
id,
name: options.name,
@@ -355,7 +352,8 @@ export class WorkspaceManager {
}
/**
* Get the path to a workspace's .mind file.
* Get the path to a workspace's legacy .mind file. Only the one-time copy of
* legacy data reads it; new workspaces do not have one.
*/
getMindPath(id: string): string {
this.assertWorkspaceId(id);