{"record":{"id":"a793cb1035f7f410","repo":"MemPalace/mempalace","slug":"sync-apply-requires-explicit-wing-or-project-dirs","errorCode":null,"errorMessage":"sync apply requires explicit wing= or project_dirs= so it cannot auto-prune every wing in a multi-project palace; pass --wing or a project directory","messagePattern":"sync apply requires explicit wing= or project_dirs= so it cannot auto-prune every wing in a multi-project palace; pass --wing or a project directory","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/sync.py","lineNumber":225,"sourceCode":"    dry_run: bool = True,\n    batch_size: int = _BATCH,\n    wal_log: Optional[Callable] = None,\n) -> SyncReport:\n    \"\"\"Prune drawers whose source files are gitignored, missing, or moved.\n\n    Returns a SyncReport with bucket counts. Dry-run by default; pass\n    dry_run=False to actually delete drawers and matching closets.\n\n    Holds ``mine_palace_lock`` for the whole call so the classify pass and\n    the apply branch see the same drawer snapshot. Raises\n    ``MineAlreadyRunning`` if another mine is in progress on this palace.\n\n    On apply (``dry_run=False``), at least one of ``wing`` or\n    ``project_dirs`` must be set so a caller cannot accidentally prune\n    every wing in a multi-project palace via auto-detected roots.\n    \"\"\"\n    if not dry_run and not wing and not project_dirs:\n        raise ValueError(\n            \"sync apply requires explicit wing= or project_dirs= so it cannot \"\n            \"auto-prune every wing in a multi-project palace; pass --wing or \"\n            \"a project directory\"\n        )\n    if project_dirs is not None and not project_dirs:\n        raise ValueError(\n            \"project_dirs was provided but is empty; pass at least one project \"\n            \"root or pass project_dirs=None to auto-detect from drawer metadata\"\n        )\n\n    counts = {\n        \"scanned\": 0,\n        \"kept\": 0,\n        \"gitignored\": 0,\n        \"missing\": 0,\n        \"no_source\": 0,\n        \"out_of_scope\": 0,\n    }","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/sync.py#L207-L243","documentation":"Error \"sync apply requires explicit wing= or project_dirs= so it cannot auto-prune every wing in a multi-project palace; pass --wing or a project directory\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/sync.py:225 when the library encounters an invalid state.","commonSituations":"Sync apply without scope could auto-prune every wing in a multi-project palace.","solutions":["Pass --wing or a project directory to scope the sync apply"],"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"}