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.
This commit is contained in:
shumeiko.it
2026-10-24 12:50:15 +02:00
parent e9ed8c0765
commit f310333970
13 changed files with 239 additions and 219 deletions

View File

@@ -62,6 +62,7 @@ Baseline: commit `b20b138` of `git.os-dev.tech/oleg.m/waggle-os`.
| UF-031 | Team sync shares the save_memory confirmation instead of the memory | Open | Team mode, memory |
| UF-032 | Team capability policies are always read from the team "default" | Open | Team mode, governance |
| UF-033 | Command palette memory search uses whichever workspace the Memory app opened last | Fixed | Sidecar, command palette |
| UF-034 | Artifact Center "related sessions" never finds a chat session | Fixed | Sidecar, Artifact Center |
## Entries
@@ -334,3 +335,12 @@ Entries UF-010 to UF-019 come from the UI audit `anti-slop/audit-001-2026-10-14.
- Cause: `MultiMind` holds one borrowed workspace handle that only the memory routes set; the palette reuses it without choosing a workspace.
- What we did: the palette searches personal memory and the memory of the active workspace (`agentState.activeWorkspaceId`) through the memory contract.
- Recommendation: pass the workspace the palette was opened in (or the active workspace) to the memory search instead of relying on shared `MultiMind` state.
### UF-034. Artifact Center "related sessions" never finds a chat session
- Status: Fixed
- Found: 2026-10-24
- Where: at commit `b20b138`, `packages/server/src/local/routes/artifacts.ts:204-222` (`GET /api/artifacts/search-related`, the `sessions` group)
- Symptom: the "Related" section of an artifact lists no chat sessions, even when a chat of the workspace discusses the artifact's topic.
- Cause: the route matches the query against the memory engine's session rows (`SessionStore.getActive()`, their `summary` and `gop_id`). Those rows are named write buckets such as 'harvest', 'agent-runs' or 'loop', not chat sessions; chat transcripts are JSONL files under `<dataDir>/workspaces/<id>/sessions/`.
- What we did: the route runs `searchSessions()` over each workspace's chat session files, the same search as `GET /api/workspaces/:id/sessions/search`, and returns the session id, title, workspace and the first matching snippet.
- Recommendation: do the same in the main project.