{"record":{"id":"a53140e2b7abd5f0","repo":"JuliusBrussee/caveman","slug":"list-memories-w","errorCode":null,"errorMessage":"list memories: %w","messagePattern":"list memories: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mem/store.go","lineNumber":602,"sourceCode":"\t\t\thi = mid - 1\n\t\t}\n\t}\n\tfor lo > 0 && lo < len(b) && !utf8.RuneStart(b[lo]) {\n\t\tlo--\n\t}\n\treturn b[:lo]\n}\n\n// Recover returns the byte-exact original for a recall hit's recovery handle.\nfunc (s *Store) Recover(handle string) ([]byte, error) {\n\treturn s.eng.Retrieve(handle)\n}\n\n// all loads every memory.\nfunc (s *Store) all() ([]Memory, error) {\n\trows, err := s.db.Query(memorySelect + ` WHERE valid_until IS NULL`)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"list memories: %w\", err)\n\t}\n\tdefer rows.Close()\n\tvar out []Memory\n\tfor rows.Next() {\n\t\tvar m Memory\n\t\tif err := scanMemory(rows, &m); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout = append(out, m)\n\t}\n\treturn out, rows.Err()\n}\n\nconst memorySelect = `SELECT id, text, created_at, valid_from, valid_until, supersedes, superseded_by FROM memories`\n\ntype rowScanner interface {\n\tScan(dest ...any) error\n}","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/mem/store.go#L584-L620","documentation":"Store.all's SELECT loading every current memory (used by Recall) failed before rows could be iterated. The wrapped error is the SQLite query failure; recall aborts rather than running on partial memory.","triggerScenarios":"Thrown at mem/store.go:602 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the recall","Check mem.db health/locks","Inspect the wrapped query error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}