Commit Graph

61 Commits

Author SHA1 Message Date
shumeiko.it
0b3e4fc339 test(core): test the SecretStore contract on VaultStore (P1.2)
secret-store.test.ts covers get, set, setAsync, writeBatch, delete,
deleteAsync, list and has through the interface. vault.test.ts keeps what is
specific to the file backend: encryption, the key file and the Windows ACL.
2026-10-24 17:35:36 +02:00
shumeiko.it
4ed21fe519 refactor: depend on SecretStore instead of the VaultStore class (P1.2)
Connectors, the connector SDK and registry, setup-connectors, provider-env,
the LiteLLM runtime config and the sidecar's `vault` decoration only read and
write secrets, so they now take the SecretStore interface. VaultStore is still
constructed in the sidecar and the service startup, and its file format is
unchanged. AGENTS.md now points at the interface.
2026-10-24 17:35:36 +02:00
shumeiko.it
9aae9d6537 refactor(core): remove the single-mind to multi-mind migration (P1.2)
needsMigration and migrateToMultiMind moved a pre-M4 default.mind to
personal.mind at startup. The community edition has no installs with that
layout, so the module, its export, the startup step, its "migration" progress
phase and the default.mind first-run check go.
2026-10-24 17:35:36 +02:00
shumeiko.it
2226ec1bd7 refactor(server): move the config.json provider-key copy out of VaultStore (P1.2)
VaultStore.migrateFromConfig had two callers, both in the server. It is now
copyProviderKeysToVault in provider-env.ts, next to
migrateLegacyProviderKeysToVault, with the same rules: copy keys that have a
value, keep keys the vault already holds, store models and baseUrl as metadata.
Its tests moved from core to provider-env.test.ts.
2026-10-24 17:35:36 +02:00
shumeiko.it
3528a242f6 refactor(agent): move the connector credential helpers out of VaultStore (P1.2)
getConnectorCredential, setConnectorCredential and setConnectorCredentialBundle
are now plain functions over a SecretStore in
packages/agent/src/connectors/connector-credentials.ts. The secret names,
metadata layout and the rule that tokens never go into plaintext metadata are
unchanged, so existing vault files keep working.

A bundle still lands as one update: SecretStore gains writeBatch, which
VaultStore applies with a single vault-file replacement.

Connector tests seed a Map-backed SecretStore instead of mocking VaultStore
methods; the helper tests from core and server moved to the agent package.
2026-10-24 17:35:36 +02:00
shumeiko.it
23431550ae build: one tsc -b build and a source export condition (P2.1)
- tsconfig.build.json references the nine in-scope packages; each package
  is composite and references the workspace packages it depends on.
  build:packages is now `tsc -b tsconfig.build.json` instead of a chain
  of cd commands.
- Every in-scope package exports its TypeScript entry under a `source`
  condition next to the dist/ entries. Vitest, tsx (dev:server, the
  Tauri dev launch, the e2e server), the sidecar and launcher bundles and
  the web app resolve it, so none of them needs build:packages first or
  can pick up a stale dist/. The vitest src aliases remain only for the
  excluded packages that have no source export.
- Published packages with a files list (agent, cli, marketplace) pack
  src/ too, so the source condition never points at a missing file.
- tsconfig.tests.json and `npm run typecheck:tests` type-check the test
  suites of the in-scope packages. They report 426 existing errors, so
  the CI step is advisory for now.
- The root test run leaves out the excluded and postponed packages
  (hive-mind-*, memory-mcp, wiki-compiler, team-server, waggle-dance,
  worker, weaver); they are not built either.
- CI runs the test job on Ubuntu, macOS and Windows with Node 22.23.2
  (ADR-0008), and no longer builds the hook runtime and the memory MCP
  server.
2026-10-24 17:14:29 +02:00
shumeiko.it
bbfb3c7f82 build: package the sidecar without the legacy memory runtime (P1.5, P1.3b)
- Stop building and staging the hive-mind CLI, the coding-agent hook
  packages and the memory MCP server: the hooks, Waggle Room and the
  memory MCP server are hidden in v1 (ADR-0002) and all of them write to
  the legacy .mind files.
- Drop sqlite-vec: nothing loads a SQLite extension since the legacy
  memory engine left. bundle-native-deps no longer copies vec0, the
  resource check no longer probes it, the Tauri shell no longer sets
  WAGGLE_SQLITE_VEC_PATH and install.sh checks plain SQLite.
- Stage bundle roots that npm keeps inside a workspace. mem0ai is not
  hoisted (it stays in packages/memory-mem0), so staging skipped it
  silently and the packaged sidecar would fail on the first memory
  access. Roots that are not installed are now listed in the output.
- js-yaml is a runtime dependency of Puppeteer's config loader since the
  WhatsApp channel moved to whatsapp-web.js (ADR-0005); it leaves the
  resource-check denylist. chromium-bidi stays unstaged: Puppeteer loads
  it only for WebDriver BiDi sessions.
2026-10-24 16:37:48 +02:00
shumeiko.it
e435e7da94 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.
2026-10-24 13:34:09 +02:00
shumeiko.it
bde961abcf test(web): use string memory ids in the Room fixtures (P1.5)
Memory ids from the memory contract are strings; the Room tests still
built memory refs with numeric frame ids and failed the app typecheck.
2026-10-24 13:22:27 +02:00
shumeiko.it
d433dca857 refactor(web): move the Memory screens onto the memory contract API (P1.5)
- adapter: memory ids are strings; single-memory calls take only the id
  (no ?mind= disambiguation). searchMemory takes the workspace as its own
  parameter. New getMemoryCapabilities / setMemoryExtraction. Removed:
  incrementFrameAccess, getMemoryOriginalSource, listSuppression,
  allowReimport, getWeaverStatus, and the dead importPreview, importCommit
  and getWikiWatermark. eraseMemory takes { id } or { sessionId }.
- memory-features reads GET /api/memory/capabilities for the knowledge
  graph; history import, wiki, hooks, Room and the memory MCP stay hidden
  (ADR-0002). useMemoryCapabilities re-renders the Memory screens.
- Settings > General has a Memory toggle for background fact extraction.
- Memory Center: the confidence filter, the erased-sources panel, the
  original-source view and the Deprecated chip are gone; Erase forgets
  every memory saved from the chat a memory came from and is offered only
  for memories with a chat session. Memory kinds follow the contract.
- Trust views show short memory labels for the new string ids and drop the
  per-row "not scored yet" badge (v1 stores no confidence).
- The Weaver maintenance view and the Cockpit weaver card are removed
  (the weaver package and its routes are deleted).
- Timeline uses the contract kinds and maps important/temporary
  importance.

Logs UF-033 (search scope sent as the workspace id), UF-034 (importance
mapping) and UF-035 (restore over open databases, open).
2026-10-24 13:19:37 +02:00
shumeiko.it
06d4532598 refactor(server): serve memory and Memory Center from the memory contract (P1.5)
The memory HTTP API reads and writes server.memory instead of the legacy
MultiMind, FrameStore, SessionStore, KnowledgeGraph, MindErasure,
SuppressionStore and RawArchive objects.

- memory.ts: search (personal, workspace, all, global), frames list, write,
  edit and delete, stats and quick capture on the contract. Ids are strings.
  The access-count route is gone. New GET /api/memory/capabilities and
  PUT /api/memory/settings { extraction } for background fact extraction.
- memory-center.ts: list, get, create, patch, archive, confirm, trace,
  delete, erase and merge on the contract. Archive sets importance
  'temporary' (skipped by recall) and remembers the old importance; confirm
  stamps metadata.confirmedAt; 'unreviewed' means extracted in the
  background and not confirmed. Erase forgets one memory or every memory of
  a chat session. The original-source and suppression routes are removed:
  there is no raw archive and no harvest to re-import from.
- knowledge.ts returns an empty graph (not part of v1).
- export.ts writes memories/personal.json and memories/workspace-<id>.json
  from the contract.
- identity.ts loses a dead resolver; the erase safety check recognizes
  waggle.db.
- memory-records.ts holds the scope, status and creation-time helpers.
- normalizeToMemory stays in memory-center-legacy.ts until home.ts and
  artifacts.ts read memory through the contract.
- @waggle/shared MemoryKind follows the contract's kinds; Memory gains
  origin and sessionId.

Tests: new memory-routes and memory-center tests on the in-memory store;
local-mode and data-export tests seed memory through the contract; tests of
removed behaviour (source, suppression, sticky erasure, graph projection,
legacy normalizer, old erase and stats) are deleted.
2026-10-24 13:19:10 +02:00
shumeiko.it
88fbc0a9e7 test(server): build cron, trace and held-action stores on WaggleDB (P1.5)
These stores take Waggle's own database since ADR-0007; the tests still
handed them a MindDB. Only the store construction changes.
2026-10-24 13:19:06 +02:00
shumeiko.it
424b46db19 test(cli): run the CLI suites on the mem0 store and waggle.db (P1.5)
The comprehensive and hard-persistence suites open a data directory the
way the REPL does: mem0 in <dir>/memory (word embedder, no model download)
and waggle.db for the profile card and tasks. Persistence across sessions
now also checks identity and tasks after reopening.

The packaged-runtime tests install @waggle/memory-contract and
@waggle/memory-mem0 with the CLI (the weaver package is gone) and check
that the REPL creates the memory store and waggle.db instead of
default.mind.

Deleted: T4 and T18 (knowledge graph entities and their persistence) and
the knowledge-graph steps of the hard-persistence run; the graph is not in
v1 (ADR-0002).
2026-10-24 13:19:06 +02:00
shumeiko.it
ac23bbd7a6 test(agent): move the agent suites onto the memory contract (P1.5)
Rewrites the orchestrator, recall, compaction, save_memory and assembler
suites for MemoryStore (createInMemoryMemoryStore; mem0 with the word
embedder for the M3b integration test), string ids, async prompt building
and setWorkspace(). Creation times are set with fake timers, since a write
cannot set its own. Stores of Waggle's own data (identity, traces) are built
on WaggleDB; the session-manager stubs use the new create() signature.

Kept behaviour: importance lane (cap, active scope, temporary exclusion),
profile and event lanes, date window and its fallback, catch-up, injection
blocking of recall and preloaded context, autosave safety, decision consent,
compaction update-in-place, reranker wiring.

New tests: recall with a workspace active versus personal only;
fetchRecentMemories ordering; toRecallFrame; context loader; save_memory
routing, dedup, rate limit, dramatic-claim downgrade and contradiction
scope; search_memory and search_all_workspaces; pattern write-back kinds,
scopes and sign gate; read_other_workspace; reranker off unless
WAGGLE_RERANKER=1, wider rerank pool, failure fallbacks.

Deleted, because the behaviour is gone:
- w46-rawdetail-recall.test.ts: the raw-turn (RAWDETAIL) recall lane.
- orchestrator.test.ts, query_knowledge (3 tests) and the recall-hardening
  M4 "Key Knowledge" test: the knowledge graph is not in v1 (ADR-0002).
- orchestrator-context-frames "profile override": scoring profiles.
- Assertions on I/P frame types, GOP sessions, FTS rows, the "Memory Facts"
  lane, cognify stages and session/entity counts were replaced by the
  equivalent contract-level checks.
2026-10-24 13:19:06 +02:00
shumeiko.it
851502d347 fix(agent): stop reporting a repeated style note as saved (P1.5)
The pattern write-back pushed a style note into its "saved" list even when
the memory store answered 'unchanged', so the chat route announced
"Auto-saved 1 memory" on every repeat of the same style signal. The legacy
code checked for the note before writing; the contract port lost that.
A style note that already exists is now neither written nor reported.
Other write-back saves keep reporting repeats, as before the port.

Not logged in upstream-fixes.md: the defect came with the P1.5 port and
does not exist in the commercial product.
2026-10-24 13:19:06 +02:00
shumeiko.it
122b45990e test(server): move the remaining server tests onto the memory contract (P1.5)
- Workspace sessions, fleet runs, agent groups, loops, the file indexer,
  external tool runs, chat and the health endpoint are checked against the
  memory store instead of .mind files. Assertions on mind-cache pins and
  releases go with the pins; the drain and cancellation checks stay.
- Delete the sticky-erasure test (harvest import was removed) and the
  session-distillation test (distillation on workspace activation was
  removed).
- The saved-history retry test checks the conversation only: the failed
  user turn is kept in workspace memory by design (#3).
2026-10-24 13:19:06 +02:00
shumeiko.it
74a4e55be0 fix(server): keep late memory refs from completing a collaboration Room (P1.5)
Chat collaboration writes run results to memory in the background and
records the memory refs when the writes finish. That update recomputed the
parent Room, so a workflow Room turned 'completed' while its synthesis step
was still running and could no longer be cancelled. A memory-refs update
never changes a run's status, so it no longer recomputes the parent.

The collaboration tests use an in-memory memory store and wait for the
background writes before reading memory refs.
2026-10-24 13:19:06 +02:00
shumeiko.it
f310333970 refactor(server): search memory through the contract in artifacts, agent runs, route proposals and onboarding (P1.5)
- Artifact Center related search lists personal and workspace memories
  through server.memory and finds related chat sessions in the session
  files (UF-034).
- /api/agent/run searches the requested workspace's memory, or personal
  memory when no known workspace is given.
- Executor briefs search only the workspace's own memory and leave out
  temporary memories in the query; route proposals no longer borrow a
  mind from the cache.
- Onboarding treats any personal memory as evidence of prior use.
- The service no longer creates personal.mind on a fresh install, and
  isFirstRun also looks for waggle.db.
2026-10-24 13:19:06 +02:00
shumeiko.it
e9ed8c0765 refactor(server): read workspace state, briefings and workspaces from the memory contract (P1.5)
- Workspace state, the "Workspace Now" block, the home briefing and the
  proactive handlers read the workspace's memory through server.memory:
  decisions are memories of kind 'decision', critical ones or ones worded
  as decisions; summaries list memories most important first. They no
  longer open workspace .mind files, so the builders are async and
  ProactiveContext carries `memory` instead of `getWorkspaceMindDb`.
- The home briefing counts extracted personal facts that are neither
  confirmed nor archived as awaiting review (memory-status.ts).
- Workspace routes count memories through the contract, seed template
  starter memories with remember() in the background (origin
  'workspace-template'), export memories through list(), and deleting a
  workspace forgets its memory scope and clears its awareness items before
  the directory is removed; the delete is refused if forgetting fails.
  agentState.releaseWorkspace() replaces closeWorkspaceMind for callers.
- The command palette searches personal memory and the active workspace's
  memory (UF-033).
- chat.ts drops the MindDB-flake diagnostics; the mind cache they guarded
  no longer serves chat turns.
2026-10-24 13:19:06 +02:00
shumeiko.it
4a1c4c4c8e fix(memory): erase forgotten memories from mem0's history database
mem0's delete kept the deleted text in memory_history, and fact extraction
keeps the last messages of each scope in the same file. forget now purges
the memory's history rows, and forgetting a whole scope also drops the
conversation messages mem0 kept for it.
2026-10-24 12:47:46 +02:00
shumeiko.it
6688c1f027 test(server): drop the WaggleDance route round-trip test (P1.1)
signal-emitter-integration.test.ts posted hook signals to /api/waggle-dance/signal on a real sidecar. The route left the sidecar with team mode; the emitter's own behaviour, fail-open included, stays covered in hive-mind-shim-core.
2026-10-24 12:17:41 +02:00
shumeiko.it
bfc9154525 build: keep pg external in the sidecar bundle (P1.1)
The previous commit dropped pg together with the team-only externals, but pg belongs to the agent's Postgres connector, which loads it on demand. Keep it external as before.
2026-10-24 12:17:41 +02:00
shumeiko.it
cd1ba288bb feat(server): turn the LiteLLM proxy off by default (P1.1)
Every sidecar start outside the desktop app looked for Python, probed
each interpreter for litellm and, when it found one, started a LiteLLM
child. The community edition must not need Python, so LiteLLM is now
opt-in: startService starts it only when config.json contains
"litellm": { "enabled": true } (WaggleConfig.isLiteLLMEnabled). Otherwise
there is no Python lookup, no LiteLLM health probe and no child process,
and the built-in provider proxy serves every request, as it already did
in the desktop app. --skip-litellm and WAGGLE_SKIP_LITELLM=1 still force
it off.

The lookup for a bundled resources/python/python.exe is removed: no
build ships one. When LiteLLM is enabled it runs on the user's own
Python from PATH.
2026-10-24 12:17:41 +02:00
shumeiko.it
c25efe6c44 refactor(server): move the team runtime into a postponed package (P1.1)
Team mode stays in the repository but is not built or shipped (ADR-0003).

- The team server (index.ts, config, db, daemons, plugins, proactive,
  routes, scheduler, services, ws, drizzle migrations) and its tests move
  from @waggle/server to packages/team-server (@waggle/team-server,
  private). It keeps its own copies of the logger and the agent-group
  executor, so it does not import @waggle/server. @clerk/fastify, bullmq,
  ioredis, postgres, drizzle-orm, drizzle-kit, cron-parser and
  @waggle/waggle-dance leave @waggle/server; the launcher drops the same
  team-only dependencies.
- build:packages no longer builds waggle-dance or the worker: nothing in
  the community edition imports them, and the worker's project reference
  would otherwise build the team server. The worker now imports from
  team-server; the team Dockerfile builds both explicitly.
- The sidecar no longer starts the team server when DATABASE_URL is set,
  and loses the team routes (/api/team/*, /api/teams), the WaggleDance
  routes and bridge (/api/waggle-dance/*), the Team server binding and
  egress guard, the WebSocket team client, the TeamSync cache and pushes,
  team audit forwarding, team workspace registration and the team
  capability-policy lookup in chat. The in-process room signal bus stays:
  agent groups, fleet runs and external tool runs use it.
  middleware/audit.ts was dead and is deleted.
- @waggle/core loses TeamSync and the teamServer part of WaggleConfig. A
  teamServer key in config.json is ignored and kept on save, as P0.1 does
  for the tier keys. Workspaces lose teamServerUrl and teamUserId; teamId
  and teamRole stay because workspaces from a shared data directory still
  carry them and the viewer write guards read them. POST /api/workspaces
  ignores team fields.
- The sidecar bundle no longer marks the team packages as external.

The agent still references the TeamSync type in orchestrator.ts and
pattern-write-back.ts; those files are being rewritten in P1.5 and drop
it there.

Logs UF-030 and UF-031 (team sync and team policy defects found while
removing the code).
2026-10-24 12:17:41 +02:00
shumeiko.it
0cbde468a9 refactor: remove S3 file storage, part of team mode (P1.2)
Nothing created an S3FileStore outside team workspaces; team storage is
postponed with team mode (ADR-0003), so such workspaces use virtual storage.
@aws-sdk/client-s3 leaves core's dependencies.
2026-10-24 12:09:05 +02:00
shumeiko.it
cb51ed0d28 refactor(core): describe secret storage as a SecretStore interface (P1.2) 2026-10-24 12:07:42 +02:00
shumeiko.it
815c667374 perf(core): check the Windows vault key ACL once per process (P1.2)
Every VaultStore construction started PowerShell to re-apply the key ACL.
The ACL does not change while the process runs; a created key is still
written and hardened by the same PowerShell call.
2026-10-24 12:07:21 +02:00
shumeiko.it
61ea8bbabf docs(oss): record the native-module strategy (ADR-0008, P1.3b) 2026-10-24 12:06:32 +02:00
shumeiko.it
8555d84b75 feat(memory): refuse to open a memory store with a different embedder
Vectors of different models are not comparable even at the same size; the
store records its embedder in waggle-memory.json and names the mismatch.
Also drop the weaver references from the cli and server tsconfigs.
2026-10-24 12:06:10 +02:00
shumeiko.it
8b5624520c docs(oss): record how the server runs on mem0 (ADR-0007) 2026-10-24 12:04:39 +02:00
shumeiko.it
55f42a1077 feat(server): run managed Ollama on Linux and skip CUDA downloads on install (P1.3b)
- Pinned Ollama 0.32.3 (and rollback 0.32.0) Linux x64/arm64 artifacts with
  their published SHA-256 and sizes; .tar.zst archives are decompressed by
  Node 22's zstd and unpacked by the system tar.
- install.sh sets ONNXRUNTIME_NODE_INSTALL_CUDA=skip: onnxruntime-node
  otherwise downloads CUDA libraries on every Linux x64 install.
- Drop the root sqlite-vec-windows-x64 dependency; the sqlite-vec package
  already carries per-platform binaries.
2026-10-24 12:04:18 +02:00
shumeiko.it
f4d2a62b24 refactor: remove the weaver package and the chat-export import (P1.5)
Weaver consolidated and decayed frames of the legacy memory engine; mem0
updates and merges memories itself. The ChatGPT/Claude export import wrote
frames and its screen is hidden in v1 (ADR-0002).
2026-10-24 12:01:22 +02:00
shumeiko.it
101523e463 test(server): cover background extraction, the legacy memory copy and run results 2026-10-24 12:00:00 +02:00
shumeiko.it
2d507dc457 fix(agent): make the recall reranker opt-in and use the word embedder in tests
The reference-set comparison showed the cross-encoder adds nothing to mem0's
ranking and costs about 130 ms per search.
2026-10-24 11:57:18 +02:00
shumeiko.it
10e67f37a5 chore(build): correct why whatsapp-web.js stays out of the sidecar bundle (P1.7)
The sidecar already bundles the AWS S3 client through other code, so it
is not a reason to keep whatsapp-web.js external. The TypeScript
compiler, pulled in by Puppeteer's config loader, is.
2026-10-24 11:56:38 +02:00
shumeiko.it
6e66028a66 feat(web): warn about the unofficial WhatsApp client and show browser setup (P1.7)
The WhatsApp card in Settings > Channels now says the client is
unofficial, that WhatsApp may block the account, and that a browser is
downloaded (about 170 MB) when none is installed. While the adapter
looks for or downloads the browser, its status detail is shown above
the QR.

The setup hint told users to send /pair from the "Message yourself"
chat, which the adapter never reads because own messages are dropped.
It now says to send it from another WhatsApp account (UF-030).
2026-10-24 11:56:38 +02:00
shumeiko.it
625545aa0f feat(server): run the WhatsApp channel on whatsapp-web.js (P1.7)
Baileys depends on libsignal (GPL-3.0), which the sidecar bundled. The
WhatsApp adapter now drives WhatsApp Web through whatsapp-web.js and
keeps its public shape: start, stop, status with the pairing QR, send
and inbound text. LocalAuth stores the session as a browser profile in
<dataDir>/channels/whatsapp; the old Baileys state is left untouched.

The browser comes from whatsapp-browser.ts: CHROME_PATH or
PUPPETEER_EXECUTABLE_PATH, then an installed Chrome, Edge or Chromium
(Windows, macOS, Linux), then a Chrome for Testing build downloaded on
the first start into <dataDir>/browsers, with progress in the status.
The root .puppeteerrc.cjs stops npm install from downloading a browser.
The sidecar build keeps whatsapp-web.js external: bundled, it fails on
__dirname and would inline LGPL node-webpmux. Text only, so ffmpeg is
never needed.

New dependencies, pinned: whatsapp-web.js 1.34.7 (Apache-2.0) and
@puppeteer/browsers 2.13.0 (Apache-2.0). Transitive: puppeteer,
puppeteer-core, chromium-bidi, webdriver-bidi-protocol (Apache-2.0),
devtools-protocol (BSD-3-Clause), extract-zip (BSD-2-Clause),
fluent-ffmpeg and the rest (MIT or ISC), and node-webpmux
(LGPL-3.0-or-later, shipped as a separate package; needs the license
review). Removed: @whiskeysockets/baileys and libsignal.

UF-020 is now Fixed; ADR-0005 records the consequences.
2026-10-24 11:56:38 +02:00
shumeiko.it
f046a20b34 test(memory): compare search quality of the old engine and mem0 on a reference set (P1.5)
Add a reference set (100 invented memories across personal memory and two
workspaces, 67 queries: paraphrase, keyword, multi-fact, scope, no-answer)
and a tsx benchmark that loads it into the old engine (MindDB, FrameStore,
HybridSearch, with and without the cross-encoder reranker), the mem0 store
and a plain-cosine baseline, all on Waggle's in-process embedder. It reports
recall@1, recall@5, MRR, latency and misses per engine and query type. The
mem0 half runs on its own (--engines mem0,cosine) once the old engine is
removed. Ollama and the user's own key are optional embedders; the bench
refuses network access to anything else and never reads OPENAI_API_KEY.

Results in docs/oss/research/memory-search-quality.md: mem0 matches the old
engine's chat-recall path (recall@1 0.72, recall@5 0.89 vs 0.90, MRR 0.82
vs 0.83) at a fraction of its latency and is acceptable for v1.

No new dependencies.
2026-10-24 11:56:35 +02:00
shumeiko.it
784ca770b1 refactor(memory): run agent recall, memory tools and the server on the memory contract (P1.5)
- Orchestrator, memory tools, context loader and pattern write-back use a
  MemoryStore and a workspace scope instead of MindDB layers; the knowledge
  graph tools, cognify, memory linker and feedback handler are gone (graph
  hidden in v1, ADR-0002).
- The server opens one mem0 store in <dataDir>/memory/, embedded by the
  in-process model on first use, and extracts facts about the user in the
  background with the model the user chose (memoryExtraction setting).
- Legacy .mind memories are copied into the store once, in the background;
  the legacy files are only read.
- Weaver consolidation, harvest, wiki, memory import, memory lanes, vector
  backfill and index reconciliation are removed; agent runs, loops, sub-agent
  results, connector fetch and the failed-turn capture write through the
  contract. Workspace sessions no longer hold a mind handle.
- FileIndexer and the install audit move to waggle.db; recall date helpers and
  the reranker are copied into core.
- The CLI REPL opens the same memory store.
2026-10-24 11:56:26 +02:00
shumeiko.it
f3eb6b6652 feat(web): ask before sending analytics, drop team screens, hide v1-absent memory features (P1.3a)
- Analytics are opt-in (decision Q7, ADR-0006). PostHog does not start or
  capture anything until the user clicks Allow in a first-run dialog that
  says what is sent. Escape or closing stores nothing and asks again. The
  existing Privacy & Telemetry toggle in Settings withdraws consent at once.
  Builds without VITE_POSTHOG_KEY show no dialog and send nothing.
- Remove the remaining upsell copy: the /team page with its per-seat price,
  Stripe and Teams wording in the erase-data dialog, Teams/Enterprise hints.
- Remove team screens (decision Q3): Waggle Dance, team presence in chat,
  team storage and sharing in workspace creation, storage and files.
- Hide memory features that are not in v1 (decision Q2) behind one map in
  lib/memory-features.ts: the knowledge graph, import history, wiki, agent
  memory hooks and Room launches. The map is the seam P1.5 fills from the
  memory store's capabilities.
- Say Windows, macOS and Linux instead of "Linux soon".
- Update the e2e specs for the removed and hidden screens.

Also logs UF-029: the Settings "Import Data" button has no handler.
2026-10-23 14:51:29 +02:00
shumeiko.it
0325c4eb11 fix(memory-mcp): keep reading profile and awareness from the .mind file
The memory MCP server serves the .mind file directly, so it uses the
substrate's IdentityLayer and AwarenessLayer instead of the waggle.db ones
that @waggle/core now exports. The WaggleDB-only constructors caught the
mismatch at build time.
2026-10-23 14:51:20 +02:00
shumeiko.it
ad2ca875cb feat(core): give Waggle its own database, apart from memory (P1.5)
Waggle kept its own tables in the memory database. Before the memory
engine can be replaced by mem0 they need a home of their own.

- add WaggleDB (<dataDir>/waggle.db). Automations, notifications, held
  actions, skill hashes, thumbs feedback, cost tracking, the profile card
  and awareness items live there. Their stores take a WaggleDB, so passing
  a memory database is a type error.
- the profile card and awareness items are now per scope ('personal' or
  'workspace:<id>') in one table each, instead of one table per .mind file
- on the first start, copy these tables from personal.mind and every
  workspace.mind (importLegacyMindData). The legacy files are only read,
  each scope is copied once and a table only while its target is empty.
- copy the logger, injection scanner, external-memory ingress guard,
  WorkspaceManager and the embedders from @waggle/hive-mind-core into
  @waggle/core, which now re-exports its own copies
- point the server, agent orchestrator and CLI at waggle.db; update the
  tests that seeded these tables in a memory database

ADR-0007 records the layout and the licensing question about the copied
files.
2026-10-23 14:31:28 +02:00
shumeiko.it
20567ecb10 test(e2e): align specs with the community edition and record the e2e baseline
The first full e2e run on this branch failed 19 tests, all on features the
community edition removed: /api/tier, Stripe, /api/compliance, the billing
settings tab, the payment pages and the upgrade dialog. Those checks now
assert that the endpoints and pages are gone (404); tier, billing and
team-settings probes are dropped from the remaining journeys. The rerun is
410 passed, 18 skipped, 0 failed.
2026-10-20 01:36:38 +02:00
shumeiko.it
01a2d8a4ce docs(oss): record the end-of-week-1 checkpoint in the baseline 2026-10-20 01:02:39 +02:00
shumeiko.it
5f088698dd chore: remove internal documents and service directories (P2.2 part 1)
The commercial repository carries the product's internal history: audits,
screenshots, briefs, decisions, pricing, publication drafts, personal data
and research runs. None of it belongs in the community edition.

- delete judging/, "UAT 3/", benchmarks/ (including LoCoMo data under
  CC BY-NC), preflight-results/, gepa-phase-5/, notes/, decisions/,
  .understand-anything/, .agents/, .lovable/, the legacy sidecar/ package
  and waggle-cowork/ (an analysis of Claude Code sources)
- delete docs/ except docs/oss, the user guides (without the team-mode
  guide), the reference, methodology, architecture, getting-started and
  contributing pages, which P2.4 rewrites
- delete render.yaml, .parity-allowlist, the retired mind-parity and
  sync-mind workflows and 29 one-off scripts nothing references
- delete tests that only checked removed files (sidecar package, Render
  blueprint, UAT capture, benchmark harness isolation, internal audit and
  signing docs); drop sidecar/ and benchmarks/ from the hive-mind subtree
  split guard; prune ignore, attribute, lint and test globs
- replace the commercial README with an interim one for this edition

Source comments still point at some deleted docs; P2.2 part 2 cleans them
together with names and paths.
2026-10-20 01:02:18 +02:00
shumeiko.it
2e1999a3f6 refactor: remove self-learning and the optimizer package (P1.4)
Self-learning is excluded from the community edition (ADR-0004); the
project owner reworks it separately. Cost tracking stays.

- agent: delete behaviour evolution (evolve-schema, iterative GEPA,
  compose-evolution, evolution gates, orchestrator and deploy),
  improvement and correction detection, AgentLearning, the eval-dataset
  builder, optimization-capture and the agent_insights tool. Secret
  detection moves from eval-dataset to secret-patterns. The LLM wiring
  keeps only the Haiku adapter and judge call used by skill audit and
  hygiene, so @ax-llm/ax is now declared by agent instead of server.
- server: delete /api/evolution/*, the evolution and optimizer services,
  GEPA expansion of the first chat message, the prompt_optimization and
  monthly_assessment jobs, the idle-session reviewer and its
  session-reviewer persona, prompt injection of past corrections and
  thumbs-down recorded as correction signals. Existing job rows of the
  removed types are ignored, not deleted.
- core: delete OptimizationLogStore; stop re-exporting the improvement
  signal and evolution run stores.
- web: delete the Evolution screen and the two job types in the
  automation editor.
- delete packages/optimizer.

Also logs UF-027 (self-learning loops read data nothing collects) and
UF-028 (the Settings prompt-shape choice is ignored by chat).
2026-10-20 00:54:58 +02:00
shumeiko.it
b734c1d3d2 refactor: remove KVARK, enterprise packs and the compliance subsystem (P1.4, P1.6)
KVARK is the commercial enterprise product and is not part of the community
edition. The agent's KVARK tools were never wired into the server, so
removing them changes no runtime behaviour beyond the routes listed here.

- agent: delete kvark-tools; CombinedRetrieval and formatCombinedResult now
  merge workspace and personal memory only (no KVARK lane, no source
  conflict note); connector substrate is always 'waggle'
- agent: promote_skill stops at workspace scope; team and enterprise scopes
  answer "not available in this edition" instead of an upgrade prompt
- server: delete src/kvark and GET /api/marketplace/enterprise-packs
- marketplace: delete ENTERPRISE_PACKS
- compliance (EU AI Act dashboard, its templates and the KVARK template
  seeded on every boot): delete core/src/compliance, the /api/compliance/*
  routes, agent compliance-pdf and the Cockpit compliance panel. The
  ai_interactions table lives in the memory substrate and goes with P1.5.
2026-10-20 00:27:16 +02:00
shumeiko.it
10ad678547 docs(oss): record the memory contract decision (ADR-0007)
ADR-0007 maps today's memory usage onto the contract and mem0: profile
card and tasks move to waggle.db, learned facts stay in mem0, extraction
runs in the background in batches. Research notes cover what mem0 3.3.1
does and how 68 files use memory today. Two defects found on the way are
logged for the main project (UF-025, UF-026).
2026-10-18 14:28:13 +02:00
shumeiko.it
cd6553061b feat(memory): add the memory contract and the local mem0 store (P0.3)
@waggle/memory-contract defines MemoryStore: remember (text, or a
conversation to extract facts from), search, list, count, get, update,
forget, forgetMatching and history over personal and workspace scopes,
with kinds, importance, source, origin and session in place of the old
content prefixes and named sessions. It ships an in-memory store and a
compatibility suite that every implementation runs.

@waggle/memory-mem0 implements the contract on mem0ai 3.3.1 in-process:
SQLite files in one directory, scope as mem0's agent_id, Waggle's own
embedder through mem0's langchain provider, fact extraction through any
OpenAI-compatible endpoint. mem0's telemetry and remote notice download
are switched off before the module loads; a test asserts that no request
is made. Memory survives a restart (tested).

New dependencies: mem0ai 3.3.1 (Apache-2.0, pinned exactly) with its
required peers compromise (MIT) and @cloudflare/workers-types (MIT OR
Apache-2.0); transitive openai (Apache-2.0), axios (MIT) and others under
MIT or BSD-2-Clause.
2026-10-18 14:28:13 +02:00
shumeiko.it
5e0c369f55 docs(oss): correct the lint baseline and note tier-dependent e2e specs
The root lint ignores apps/web, which has its own config and 49
pre-existing errors. Several e2e specs still exercise the removed tier and
Stripe endpoints; they are updated with the first e2e run.
2026-10-15 19:31:50 +02:00