Add spec ops and config expectations to deployment guide#165
Add spec ops and config expectations to deployment guide#165
Conversation
| if ( | ||
| (a.created_at or datetime.min) < cursor_ts | ||
| or ( | ||
| (a.created_at or datetime.min) == cursor_ts |
There was a problem hiding this comment.
Bug: Timezone mismatch causes cursor pagination to silently fail
The memory store stores naive datetimes (via datetime.utcnow()), but decode_time_id_cursor and decode_artifact_cursor return timezone-aware datetimes (with timezone.utc). Comparing naive and aware datetimes in Python raises TypeError. The comparison at line 1146 (a.created_at < cursor_ts) will fail when a.created_at is naive and cursor_ts is aware. The exception is caught by the except Exception block, which logs a misleading "cursor_decode_failed" message and proceeds without applying cursor filtering, causing pagination to silently return incorrect results. The same issue exists for contexts and chunks pagination in the memory store.
Additional Locations (2)
| for patch in list_patches(): | ||
| if ( | ||
| isinstance(patch.meta, dict) | ||
| and patch.meta.get("auto_prune") |
There was a problem hiding this comment.
Bug: Auto-prune duplicate detection checks wrong field, fails silently
The duplicate detection logic for auto-prune recommendations checks patch.meta.get("auto_prune") to find existing patches, but ConfigPatchAudit.meta is never set when creating patches - it remains None. The auto-prune marker exists only in patch.patch["ops"][0]["path"] (the JSON Patch operation targeting /meta/auto_prune), not in the separate meta field. Since isinstance(patch.meta, dict) is always False, existing auto-prune patches are never detected, causing duplicate recommendations to be created for the same adapters on every 6-hour sweep.
Summary
Testing
Codex Task
Note
Add keyset cursor pagination and metadata to list endpoints, introduce adapter prune recommendations and clustering fixes, and publish a comprehensive deployment guide.
GET /v1/artifacts,GET /v1/contexts, andGET /v1/contexts/{id}/chunks; responses now includehas_next,next_page,next_cursor, andpage_size.cursor; computenext_cursorvia new helpers.liminallm/storage/cursors.py(encode/decode_*_cursor).PostgresStore.list_artifacts/list_contexts/list_chunksandMemoryStore.list_artifacts/list_contexts/list_chunks; adjust ordering and bounds; fix max-page sentinel logic; make_safe_floatinstance-logged.PostgresStoreon slow acquires.TrainingWorker: await async store listings; add periodic adapter prune recommendations via ConfigOps; schedule pruning alongside clustering.liminallm/api/routes.py):next_cursorwithencode_artifact_cursor/encode_time_id_cursor/encode_index_cursor.docs/DEPLOYMENT.mdwith Docker/manual setup, ops/safety defaults, config management, hybrid scenarios, and troubleshooting.README.mdto point to deployment guide; revisedocs/ISSUES.mdaudit status and record related fixes/verifications.Written by Cursor Bugbot for commit 673553d. This will update automatically on new commits. Configure here.