{"record":{"id":"a6866abf005c2b1e","repo":"JuliusBrussee/caveman","slug":"ccr-typed-object-list-scan-w","errorCode":null,"errorMessage":"ccr typed object list scan: %w","messagePattern":"ccr typed object list scan: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/ccr/store_sqlite.go","lineNumber":636,"sourceCode":"}\n\nfunc (s *Store) ListSessionObjects(sessionID string, limit int) ([]Object, error) {\n\tif limit <= 0 {\n\t\tlimit = 100\n\t}\n\tif limit > 10000 {\n\t\tlimit = 10000\n\t}\n\trows, err := s.db.Query(`SELECT `+objectColumns+` FROM typed_objects WHERE session_id = ? ORDER BY created_at DESC, object_id DESC LIMIT ?`, sessionID, limit)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ccr typed object list: %w\", err)\n\t}\n\tdefer rows.Close()\n\tobjects := make([]Object, 0)\n\tfor rows.Next() {\n\t\tobj, err := scanObject(rows)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"ccr typed object list scan: %w\", err)\n\t\t}\n\t\tobjects = append(objects, obj)\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"ccr typed object list rows: %w\", err)\n\t}\n\treturn objects, nil\n}\n\n// FindTaskDecision returns one Decision Ledger object by its stable decision\n// ID. Callers still validate the versioned decision schema before rendering it.\nfunc (s *Store) FindTaskDecision(decisionID string) (Object, error) {\n\tobj, err := scanObject(s.db.QueryRow(\n\t\t`SELECT `+objectColumns+` FROM typed_objects\n\t\t WHERE object_type = ? AND json_extract(CAST(data AS TEXT), '$.decision_id') = ?\n\t\t ORDER BY created_at DESC, object_id DESC LIMIT 1`,\n\t\tObjectTaskDecision, decisionID,\n\t))","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/ccr/store_sqlite.go#L618-L654","documentation":"Wraps scanObject's failure while iterating session-object rows in ListSessionObjects. One row could not be materialized (bad timestamp or dependencies JSON), so the whole listing aborts rather than returning a partial set.","triggerScenarios":"Thrown at engine/ccr/store_sqlite.go:636 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect and repair or delete the corrupt row (see scanObject's created_at/dependencies errors)","Re-put the affected objects to rewrite valid rows","Recreate the store if corruption is widespread"],"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"}