Commit Graph

37 Commits

Author SHA1 Message Date
shumeiko.it
48bdab8087 fix(server): generate personas through the built-in proxy (UF-045)
POST /api/personas/generate posted to /api/anthropic/v1/messages, a route
that does not exist, with no session token and a port built from
address().toString(), so the URL did not even parse. It also pinned
claude-sonnet-4-6, which needs an Anthropic key.

The route now calls the built-in proxy through self-request.ts, reads the
OpenAI-format reply, and picks the model from the user's default with the
same fallback chat uses, so a local Ollama model works too. An end-to-end
test with localhost trust off checks the generated persona comes back.
2026-10-26 01:50:47 +01:00
shumeiko.it
d6217ad7c2 fix(server): send the session token on the sidecar's calls to its own proxy (UF-044)
Since the server stopped trusting loopback callers, the built-in model proxy
needs the session token like every other route, but the sidecar's own calls
to it sent none. The Models key check read the proxy's 401 as a rejected key,
so a working Anthropic key showed "Key found but not responding". Scheduled AI
tasks and loops, the dream diary narrative and the profile calls failed the
same way; the profile calls also built the port from address().toString(),
and the scheduled tasks used the configured port, which the desktop app's
port fallback can leave pointing at another Waggle server.

self-request.ts now builds the address from the bound port and adds the
session token; all these calls and command.ts use it, and the token is never
sent to Ollama. An end-to-end test runs the key check through the real
middleware and proxy with localhost trust off; it fails without the fix.

UF-045 records the persona generator, which posts to a route that does not
exist; it is left open.
2026-10-26 01:46:29 +01:00
shumeiko.it
5268881f46 docs(oss): how to build the Windows desktop installer 2026-10-26 00:43:43 +01:00
shumeiko.it
ae8233b8f6 fix(web): give the chat composer a single focus outline (UF-043)
The composer textarea drew its own focus ring inside the rounded box, which
already turns amber on focus-within. The ring is gone; the box's border stays
the focus indicator (8.14:1 dark, 4.92:1 light against the composer).
2026-10-26 00:32:11 +01:00
shumeiko.it
efcb19e682 fix(web): show sidebar hints only on the icon rail, above the main area (UF-042)
With the full-width sidebar every item showed a hover hint that repeated its
visible label, and the part of the hint that reached past the sidebar was
hidden wherever the main area had content: the hint rendered inside the nav,
and the nav and <main> are sibling z-10 layers.

Sidebar hints now show only on the icon rail below lg, where they are the
only label, and render in document.body through a new opt-in `portal` flag
on HintTooltip. Other hints keep rendering in place, since several sit in
overlays above z-50 where a portaled hint would end up underneath.
2026-10-25 23:37:20 +01:00
shumeiko.it
07a529512c fix(server): let the CLI server exit on Ctrl+C and SIGTERM (UF-041)
The OAuth routes started a module-level cleanup interval that was never
cleared or unref'd. The service's SIGTERM/SIGINT handler closes the server
and relies on the event loop going empty, so the process kept running: a
first Ctrl+C in `npx waggle` or `npm run dev:server` left it alive, and
SIGTERM never ended it. The interval is now unref'd.

The launcher tests left two `waggle` processes behind on every run: they
stopped `npx` but not the waggle process it started. They now start it in
its own process group and stop the whole group, with a SIGKILL fallback,
and a new test checks that the built CLI exits by itself after SIGTERM.
2026-10-25 23:01:05 +01:00
shumeiko.it
2e08f2ae96 refactor(server): move the install audit trail from core to the server (P1.2, UF-040)
Core keeps only shared infrastructure, so InstallAuditStore leaves it and
lives in packages/server/src/local/install-audit.ts. The trail itself stays:
the Audit and Activity tabs, the extend and export routes, and the threat
model entry keep working on the same waggle.db table.

- @waggle/shared gets RecordAuditInput and the narrow InstallAuditRecorder
  (record only), which the agent's skill tools now depend on.
- The server creates the audit table before the one-time legacy copy, which
  no longer constructs it in core.
- UF-040: GET /api/debug/logs called prepare() on the store's private db
  wrapper, which has none, so the support bundle never carried recent
  installs. It now reads them through getRecentSummary().
2026-10-25 21:32:38 +01:00
shumeiko.it
3befcd8e9b docs: how to build the desktop app, and the packaged macOS launch 2026-10-24 19:18:02 +02:00
shumeiko.it
1f536151d8 fix(desktop): find the sidecar in a macOS app bundle and fit the startup screen (UF-004, UF-017)
- The packaged macOS app stayed on "Starting Waggle…": the shell looked
  for node, service.js, native/ and node_modules/ next to the executable,
  the Windows layout, while a macOS bundle keeps them in
  Contents/Resources/resources. bundled_resources_dir() checks both.
- The startup screen used min-height 100vh on an unstyled body, which
  showed scroll bars, and a fixed light text colour that is invisible in
  the light theme. It is now styled from index.html, fixed to the window,
  with a dark text colour for the light theme.
2026-10-24 19:10:23 +02:00
shumeiko.it
276808cd69 docs(oss): record the end-of-week-2 checkpoint 2026-10-24 18:27:12 +02:00
shumeiko.it
8a9ba09ad9 fix(server): refuse memory writes for a workspace that does not exist (UF-039)
POST /api/memory/frames, /api/quick-capture and the Memory Center's
POST /api/memory saved a memory meant for an unknown workspace into
personal memory, which every workspace reads. They now answer 404
workspace_not_found and write nothing; a request without a workspace
still goes to personal memory.
2026-10-24 18:09:43 +02:00
shumeiko.it
4dbab2cb8b docs: describe the community edition after the move to mem0 and the unified build
AGENTS.md no longer describes memory as half-migrated or asks for
build:packages before running the sidecar, lists the tsc -b build and the
test typecheck among the checks, and drops the removed weaver package.
ADR-0007 and ADR-0008 record that core no longer re-exports the legacy
substrate and that sqlite-vec is gone.
2026-10-24 17:56:20 +02:00
shumeiko.it
2c376f21cf docs(oss): log the Marketplace hot-reload notification that never reaches the sidecar (UF-038) 2026-10-24 17:39:20 +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
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
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
61ea8bbabf docs(oss): record the native-module strategy (ADR-0008, P1.3b) 2026-10-24 12:06:32 +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
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
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
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
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
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
shumeiko.it
d2b6506f8b build: declare workspace dependencies and check them in CI (P0.2)
Packages relied on npm hoisting for imports they never declared, so a
package installed on its own fails (UF-024).

- server: + @waggle/marketplace, @waggle/sdk, @waggle/weaver, zod (MIT),
  @anthropic-ai/sdk (MIT), @ax-llm/ax (Apache-2.0);
  - @waggle/hive-mind-shim-core and stripe (unused)
- agent: + pdf-parse (Apache-2.0); playwright-core (Apache-2.0) as an
  optional peer, since it is loaded only when available
- worker: + @waggle/waggle-dance; web: + @waggle/shared
- launcher: + @waggle/server as a dev dependency (bundled by tsup);
  - stripe; cli: - @waggle/weaver (unused); root: - stripe

scripts/check-workspace-deps.mjs (npm run check:deps) compares the
imports in each community-edition package's src/ with its manifest and
runs in CI. Two imports wait for P1.4 (optimizer, evolution wiring).
2026-10-15 19:31:50 +02:00
shumeiko.it
fe2eb0f648 refactor: remove the billing tier model (P0.1)
The community edition has no monetization (ADR-0001). Remove the tier
model (packages/shared/src/tiers.ts), the requireTier middleware and every
tier gate, GET/PATCH /api/tier and the trial start, and the Stripe
integration, which depends on the tier model.

Personal features a tier used to limit are open to everyone: unlimited
workspaces and connectors, every embedding provider including LiteLLM,
per-workspace costs, Approvals. The workspace session cap is one constant
(100). Team and enterprise surfaces are hidden instead of unlocked (team
dock zone, Settings Team/Enterprise/Plan tabs, workspace Team tab);
cloud sync reports unavailable, as it did for free users.

The sidecar ignores the tier keys in config.json but does not delete them:
both editions may still share ~/.waggle.

Web billing UI is deleted: plan cards, upgrade and trial modals, payment
success route, the KVARK sales block, tier 403 handling.
2026-10-15 19:31:50 +02:00
shumeiko.it
ea21721d2a docs(oss): record owner decisions as ADRs and the starting baseline
ADR-0001..0006 capture the scope decisions: no monetization, memory
through a contract backed by local mem0 (knowledge graph deferred), team
mode postponed, cost tracking open and self-learning out, whatsapp-web.js
for WhatsApp, opt-in analytics. baseline.md records build, typecheck,
lint and unit test results on macOS before scope work starts.
2026-10-15 18:35:58 +02:00
shumeiko.it
2346cf3ca4 test: keep unit tests out of the developer's home directory
The marketplace installer and the skill security cache resolve paths from
os.homedir() at import time, so npm run test wrote fixtures into the real
~/.waggle/security-cache and ~/.waggle/plugins/registry.json. Point HOME
and USERPROFILE at a temporary directory per worker and silence npm's
update notice that a fresh home triggers (UF-022). Log the four test
files that fail on macOS (UF-023).
2026-10-15 18:35:39 +02:00
shumeiko.it
214c6e66b5 docs(oss): add the upstream fixes log for the main project
Defects found while preparing the community edition: what we saw, why it
happens, what we changed and what the main project should change.
2026-10-15 18:13:59 +02:00
Oleg Maslov
b20b138fe4 moving 2026-09-02 10:14:22 +02:00
Oleg Maslov
0c3e2ead3b moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled
2026-09-02 10:10:29 +02:00