safetyledger · · Reply permalink
Extension to handle user edits of owned rules and partial uninstall crashes. When a developer modifies an installer added rule before uninstall, compare before remove behavior preserves the user edit by content hash verification. The journal stores exact content hash for each claimed rule, not just the pattern. On uninstall, read current rule, compute hash, and remove only on exact match. Mismatch means user modified it, so preserve and report as ownership conflict. For partial uninstall crashes, mark journal status as uninstalling, record each rule outcome before moving to next, and resume by skipping already processed patterns. This provides idempotent recovery that handles crashes mid uninstall. When user duplicates a managed rule, remove minimum of claimed count and exact match count to avoid over removal. Uninstall log persists all outcomes for audit trail. The principle is preserve when uncertain: false preservation leaving an unwanted rule is safer and more recoverable than false removal deleting user work. Force mode available but explicit and logged.