{"record":{"id":"d75840ec82abda71","repo":"MemPalace/mempalace","slug":"post-repair-detection-still-found-len-remaining","errorCode":null,"errorMessage":"Post-repair detection still found {len(remaining)} poisoned row(s): {[sid for sid, _ in remaining]}. Backup at {result['backup']}.","messagePattern":"Post-repair detection still found (.+?) poisoned row\\(s\\): (.+?)\\. Backup at (.+?)\\.","errorType":"exception","errorClass":"MaxSeqIdVerificationError","httpStatus":null,"severity":"error","filePath":"mempalace/repair.py","lineNumber":2392,"sourceCode":"        )\n\n    _close_chroma_handles(palace_path)\n\n    with sqlite3.connect(db_path) as conn:\n        conn.execute(\"BEGIN\")\n        try:\n            conn.executemany(\n                \"UPDATE max_seq_id SET seq_id = ? WHERE segment_id = ?\",\n                [(new_val, seg_id) for seg_id, _old, new_val in plan],\n            )\n            conn.commit()\n        except Exception:\n            conn.rollback()\n            raise\n\n    remaining = _detect_poisoned_max_seq_ids(db_path, segment=segment, threshold=threshold)\n    if remaining:\n        raise MaxSeqIdVerificationError(\n            f\"Post-repair detection still found {len(remaining)} poisoned row(s): \"\n            f\"{[sid for sid, _ in remaining]}. Backup at {result['backup']}.\"\n        )\n\n    result[\"segment_repaired\"] = [seg_id for seg_id, _old, _new in plan]\n    print(f\"\\n  Repair complete. {len(plan)} row(s) restored.\")\n    print(f\"  Backup:  {result['backup'] or '(skipped)'}\")\n    print(f\"\\n{'=' * 55}\\n\")\n    return result\n\n\nif __name__ == \"__main__\":\n    p = argparse.ArgumentParser(description=\"MemPalace repair tools\")\n    p.add_argument(\"command\", choices=[\"status\", \"scan\", \"prune\", \"rebuild\"])\n    p.add_argument(\"--palace\", default=None, help=\"Palace directory path\")\n    p.add_argument(\"--wing\", default=None, help=\"Scan only this wing\")\n    p.add_argument(\"--confirm\", action=\"store_true\", help=\"Actually delete corrupt IDs\")\n    args = p.parse_args()","sourceCodeStart":2374,"sourceCodeEnd":2410,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/repair.py#L2374-L2410","documentation":"Error \"Post-repair detection still found {len(remaining)} poisoned row(s): {[sid for sid, _ in remaining]}. Backup at {result['backup']}.\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/repair.py:2392 when the library encounters an invalid state.","commonSituations":"Repair pass completed but poisoned rows remained.","solutions":["Investigate the remaining poisoned rows; the backup is preserved at the reported path"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}